Skip to content

Commit

Permalink
Merge pull request #476 from bounswe/refactor/FE-dockerfile
Browse files Browse the repository at this point in the history
[FE] Refactor dockerfile for production env
  • Loading branch information
hikasap authored Dec 12, 2024
2 parents e5d1c7e + 65e9f1b commit 91bc3c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 1 addition & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,11 @@ services:
context: ./frontend
dockerfile: Dockerfile
container_name: frontend
command: sh -c "npm start"
restart: always
environment:
REACT_APP_API_BASE_URL: 'http://0.0.0.0:8000'
ports:
- "3000:3000"
- "3000:80"
depends_on:
- backend
networks:
Expand Down
9 changes: 6 additions & 3 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
FROM node:18-bullseye-slim
FROM node:18-bullseye-slim AS build
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "start"]
RUN npm run build
FROM nginx:alpine
COPY --from=build /app/build /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

0 comments on commit 91bc3c1

Please sign in to comment.