Skip to content

Commit

Permalink
edit docker-compose, front/Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
hitoshi555 committed Apr 17, 2024
1 parent aa3c1af commit 3d554d3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 24 deletions.
34 changes: 11 additions & 23 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
version: '3.8'

services:
app:
backend:
container_name: nestjs-backend
build:
context: ./back
dockerfile: Dockerfile
ports:
- "3000:3000"
depends_on:
- db
volumes:
- ./back:/usr/src/app
- /usr/src/app/node_modules
environment:
- DATABASE_HOST=db
- DATABASE_USER=root
- DATABASE_PASSWORD=secret
- DATABASE_NAME=test
- NODE_ENV=production

frontend:
container_name: vue-frontend
Expand All @@ -22,21 +21,10 @@ services:
dockerfile: Dockerfile
ports:
- "80:80"
depends_on:
- app

db:
container_name: mysql-db-sample
image: mysql:5.7
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: secret
MYSQL_DATABASE: test
MYSQL_USER: user
MYSQL_PASSWORD: secret
volumes:
- db-data:/var/lib/mysql
- ./front:/app
- /app/node_modules

volumes:
db-data:
networks:
default:
driver: bridge
2 changes: 1 addition & 1 deletion front/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ RUN npm run build
FROM nginx:alpine
COPY --from=0 /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
CMD ["nginx", "-g", "daemon off;"]

0 comments on commit 3d554d3

Please sign in to comment.