Skip to content

Commit 3620626

Browse files
committed
feat: The docker-compose file is used to the multi-container.
1 parent d564d78 commit 3620626

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Logs
2+
*.log
3+
*.log.*
4+
5+
# Environment variables
6+
.env
7+
8+
# Ignore macOS system files
9+
.DS_Store
10+
11+
# Ignore local IDE settings
12+
.vscode/
13+
.idea/
14+
15+
# Ignore Docker files (to prevent committing local docker-specific config)
16+
*.dockerignore
17+
docker-compose.override.yml

docker-compose.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
version: '3.8'
2+
services:
3+
frontend:
4+
build: ./front-end-nextjs
5+
working_dir: /app
6+
command: sh -c "npm run build && npm start"
7+
ports:
8+
- "3000:3000" # Map host port 3000 to container port 3000
9+
volumes:
10+
- ./front-end-nextjs:/app
11+
environment:
12+
- NODE_ENV=production
13+
depends_on:
14+
- backend # Ensure frontend waits for backend to start
15+
16+
backend:
17+
build: ./api
18+
ports:
19+
- "8000:80" # Map host port 8000 to container port 80 (FastAPI)
20+
volumes:
21+
- ./api:/usr/src/app # Bind mount for live updates
22+
environment:
23+
- FASTAPI_ENV=production

0 commit comments

Comments
 (0)