Skip to content

Commit

Permalink
Merge pull request #54 from 240708-NET/client-image
Browse files Browse the repository at this point in the history
Fix copy errors in web client dockerfile
  • Loading branch information
RobertTan054 authored Aug 29, 2024
2 parents 9480834 + bb5edb1 commit 41c935b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 26 deletions.
42 changes: 26 additions & 16 deletions src/Web/client/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,38 @@
# javascript
**/node_modules/
.next
.eslintrc.js

# docker
Dockerfile*
docker-compose*
.dockerignore

# build/test/deploy
**/dist
npm-debug.log
build
scripts
.env
.env.local
.coverage
.coverage.*
.env
.aws
build
scripts

# git
.git
.gitignore
.next
README.md
LICENSE
Dockerfile*
docker-compose*
.dockerignore
.gitlab-ci.yml

# log
*.log
*.log*

# editor
.vscode
.DS_Store
.gitignore
.editorconfig
.env
.env.local
.gitlab-ci.yml
.eslintrc.js
*.swp

# other
README.md
LICENSE
.DS_Store
9 changes: 2 additions & 7 deletions src/Web/client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
FROM node:alpine AS build
WORKDIR /app
# COPY below depends on .dockerignore to exclude node_modules, .next, etc.
COPY . .
RUN npm ci
RUN npm run build

FROM node:alpine AS run
WORKDIR /app
COPY --from=build /app/package*.json .
COPY --from=build /app/.next .
RUN npm ci
ENTRYPOINT ["npm", "run", "start"]
ENTRYPOINT ["npm", "run", "start"]

EXPOSE 3000
6 changes: 3 additions & 3 deletions src/Web/client/Dockerfile-dev
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM node:alpine
WORKDIR /app
COPY package*.json .
# COPY below depends on .dockerignore to exclude node_modules, .next, etc.
COPY . .
RUN npm ci
RUN npm run build
COPY . .
ENTRYPOINT ["npm", "run", "dev"]

EXPOSE 3000
EXPOSE 3000

0 comments on commit 41c935b

Please sign in to comment.