Skip to content

Commit

Permalink
Merge pull request #2559 from traPtitech/feat/fetch-frontend-on-docke…
Browse files Browse the repository at this point in the history
…r-build
  • Loading branch information
ras0q authored Jan 17, 2025
2 parents 2e0fc41 + dd979f6 commit e88f5d5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/renovate/regex-manager.json5
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
{
"description": "GitHub URL dependencies",
"fileMatch": [
".+\\.ya?ml$", "(^|/)Makefile$"
".+\\.ya?ml$", "(^|/)Makefile$", "^Dockerfile.*"
],
"matchStrings": [
// Example: kustomize build https://github.com/argoproj/argo-cd//manifests/crds?ref=v2.7.6 | kubectl create -f -
Expand Down
11 changes: 0 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,6 @@ db-lint: ## Lint db docs according to .tbls.yml
TRAQ_MARIADB_PORT=$(TEST_DB_PORT) go run main.go migrate --reset
docker run --rm --net=host -e TBLS_DSN="mariadb://root:[email protected]:$(TEST_DB_PORT)/traq" -v $$PWD:/work -w /work ghcr.io/k1low/tbls:$(TBLS_VERSION) lint -c .tbls.yml

.PHONY: update-frontend
update-frontend: ## Update frontend files in dev/frontend
@mkdir -p ./dev/frontend
# renovate:github-url
@curl -L -Ss https://github.com/traPtitech/traQ_S-UI/releases/download/v3.22.1/dist.tar.gz | tar zxv -C ./dev/frontend/ --strip-components=2

.PHONY: reset-frontend
reset-frontend: ## Completely replace frontend files in dev/frontend
rm -rf ./dev/frontend
@make update-frontend

.PHONY: up
up: ## Build and start the app containers
@docker compose up -d --build
Expand Down
7 changes: 3 additions & 4 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,16 @@ services:
- app:/app/storage

frontend:
image: caddy:2.9.1-alpine
build:
context: ./dev
dockerfile: Dockerfile-frontend
restart: always
expose:
- "80"
ports:
- "3000:80"
depends_on:
- backend
volumes:
- ./dev/Caddyfile:/etc/caddy/Caddyfile:ro
- ./dev/frontend:/usr/share/caddy:ro

mysql:
image: mariadb:10.11.10
Expand Down
5 changes: 5 additions & 0 deletions dev/Dockerfile-frontend
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM caddy:2.9.1-alpine

COPY ./Caddyfile /etc/caddy/Caddyfile

RUN wget -O - https://github.com/traPtitech/traQ_S-UI/releases/download/v3.22.1/dist.tar.gz | tar zxv -C /usr/share/caddy/ --strip-components=2
5 changes: 1 addition & 4 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ If you want to contribute to traQ, then follow this section.
### Setup Local Server with Docker

#### First Up (or entirely rebuild)
`make update-frontend && make up`
`make up`

Now you can access to
+ `http://localhost:3000` for traQ
Expand All @@ -30,9 +30,6 @@ Now you can access to
#### Rebuild traQ
`make up`

#### Update frontend
`make update-frontend` or `make reset-frontend`

#### Destroy Containers
`make down`

Expand Down

0 comments on commit e88f5d5

Please sign in to comment.