Skip to content

Commit

Permalink
add volume for frontend service, add run-dev target in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
AzamatKomaev committed Oct 2, 2024
1 parent 60ce7f4 commit e6a2b1c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ services:
frontend:
build:
context: ./frontend
target: dev-run
container_name: calendar-frontend
restart: always
volumes:
- ./frontend/src:/app/src
ports:
- "3000:80"
- "3000:3000"

volumes:
redis_data:
7 changes: 6 additions & 1 deletion frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ COPY . /app

RUN npm run build

FROM nginx:1.23-alpine

FROM node-build AS dev-run
cmd ["npm", "run", "start"]


FROM nginx:1.23-alpine as prod-run

COPY --from=node-build /app/build /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
Expand Down

0 comments on commit e6a2b1c

Please sign in to comment.