Skip to content

Commit

Permalink
Merge pull request #298 from isucon/move-built_front
Browse files Browse the repository at this point in the history
[frontend,infra] フロントのソースコードを競技者 VM に載せないようにした
  • Loading branch information
ShotaKitazawa authored Jul 9, 2021
2 parents fc40ce3 + f31315d commit cce814b
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion development/backend-go/ci.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 1 addition & 1 deletion development/backend-go/dev.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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

1 change: 1 addition & 0 deletions webapp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/public
2 changes: 1 addition & 1 deletion webapp/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion webapp/go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit cce814b

Please sign in to comment.