Skip to content

Commit

Permalink
♻️ create frontend dist only in container
Browse files Browse the repository at this point in the history
  • Loading branch information
ras0q committed May 13, 2023
1 parent 09425d3 commit ebcefa1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .air.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tmp_dir = "tmp"
bin = "./tmp/main"
cmd = "go build -o ./tmp/main ."
delay = 0
exclude_dir = ["assets", "tmp", "vendor", "testdata"]
exclude_dir = ["development", "docs", "tmp"]
exclude_file = []
exclude_regex = ["_test.go"]
exclude_unchanged = false
Expand Down
9 changes: 3 additions & 6 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
/vendor/
.git
.gitignore
.gitmodules
.dockerignore
.DS_Store
development
docs
tmp
README.md
room
service.json

/development/
/web/node_modules
/web/dist
10 changes: 8 additions & 2 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@
FROM golang:1.20.4-alpine
WORKDIR /srv/knoq

RUN go install github.com/cosmtrek/air@latest

COPY go.mod ./
COPY go.sum ./
ENV GO111MODULE=on
RUN go mod download
COPY ./ ./

RUN mkdir -p ./web/dist \
&& apk add --no-cache curl \
&& curl -L -Ss https://github.com/traPtitech/knoQ-UI/releases/latest/download/dist.tar.gz \
| tar zxv -C ./web
RUN touch ./service.json

RUN go install github.com/cosmtrek/air@latest

ENTRYPOINT ["air", "-c", ".air.toml"]
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ version: "3"
networks:
default:


services:
knoq:
build:
Expand Down Expand Up @@ -36,8 +37,6 @@ services:
- ./presentation:/srv/knoq/presentation
- ./usecase:/srv/knoq/usecase
- ./parsing:/srv/knoq/parsing
- ./development/dist:/srv/knoq/web/dist
- ./development/service.json:/srv/knoq/service.json
ports:
- "6006:3000"
depends_on:
Expand Down

0 comments on commit ebcefa1

Please sign in to comment.