diff --git a/development/backend-go/ci.dockerfile b/development/backend-go/ci.dockerfile index a5f1af913..e4503a392 100644 --- a/development/backend-go/ci.dockerfile +++ b/development/backend-go/ci.dockerfile @@ -28,7 +28,7 @@ COPY webapp/go/go.mod webapp/go/go.sum ./ RUN go mod download COPY webapp/go/ . -COPY --from=frontend /app /webapp/frontend +COPY --from=frontend /public /webapp/public RUN go build -o app . ENTRYPOINT ["dockerize", "-wait=tcp://mysql-backend:3306", "-timeout=60s", "./app"] diff --git a/development/backend-go/dev.dockerfile b/development/backend-go/dev.dockerfile index 906a0e5b9..20f34df35 100644 --- a/development/backend-go/dev.dockerfile +++ b/development/backend-go/dev.dockerfile @@ -30,4 +30,4 @@ COPY webapp/go/go.sum . RUN go mod download -COPY --from=frontend /app /webapp/frontend +COPY --from=frontend /public /webapp/public diff --git a/provisioning/ansible/roles/contestant/tasks/isucondition-frontend.yml b/provisioning/ansible/roles/contestant/tasks/isucondition-frontend.yml index a5fd6448f..09a03d4c3 100644 --- a/provisioning/ansible/roles/contestant/tasks/isucondition-frontend.yml +++ b/provisioning/ansible/roles/contestant/tasks/isucondition-frontend.yml @@ -15,8 +15,9 @@ PATH: "/home/isucon/local/node/bin:{{ ansible_env.PATH }}" command: npm run build -- name: "roles/contestant/tasks/isucondition-frontend: Deploy static files" +- name: "roles/contestant/tasks/isucondition-frontend: Remove frontend source code" become_user: root - shell: | - mkdir -p /www/data && cp -pR /home/isucon/webapp/frontend/dist/* /www/data/ + file: + path: /home/isucon/webapp/frontend + state: absent diff --git a/webapp/.gitignore b/webapp/.gitignore new file mode 100644 index 000000000..c75eeccc8 --- /dev/null +++ b/webapp/.gitignore @@ -0,0 +1 @@ +/public diff --git a/webapp/frontend/package.json b/webapp/frontend/package.json index 0862fe9ab..08811ff57 100644 --- a/webapp/frontend/package.json +++ b/webapp/frontend/package.json @@ -2,7 +2,7 @@ "version": "0.0.0", "scripts": { "dev": "vite --port 3333", - "build": "tsc && vite build", + "build": "tsc && vite build --outDir ../public", "serve": "vite preview", "lint": "eslint . --ext .js,.ts,.jsx,.tsx", "fmt": "prettier . --write", diff --git a/webapp/go/main.go b/webapp/go/main.go index 70a871e45..67c9c8051 100644 --- a/webapp/go/main.go +++ b/webapp/go/main.go @@ -34,7 +34,7 @@ const ( searchLimit = 20 conditionLimit = 20 isuListLimit = 200 // TODO 修正が必要なら変更 - frontendContentsPath = "../frontend/dist" + frontendContentsPath = "../public" jwtVerificationKeyPath = "../ec256-public.pem" defaultIconFilePath = "../NoImage.png" defaultJIAServiceURL = "http://localhost:5000"