Skip to content

Commit

Permalink
feat: The docker-compose file is used to the multi-container.
Browse files Browse the repository at this point in the history
  • Loading branch information
Suraj-kumar00 committed Oct 10, 2024
1 parent d564d78 commit 3620626
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Logs
*.log
*.log.*

# Environment variables
.env

# Ignore macOS system files
.DS_Store

# Ignore local IDE settings
.vscode/
.idea/

# Ignore Docker files (to prevent committing local docker-specific config)
*.dockerignore
docker-compose.override.yml
23 changes: 23 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: '3.8'
services:
frontend:
build: ./front-end-nextjs
working_dir: /app
command: sh -c "npm run build && npm start"
ports:
- "3000:3000" # Map host port 3000 to container port 3000
volumes:
- ./front-end-nextjs:/app
environment:
- NODE_ENV=production
depends_on:
- backend # Ensure frontend waits for backend to start

backend:
build: ./api
ports:
- "8000:80" # Map host port 8000 to container port 80 (FastAPI)
volumes:
- ./api:/usr/src/app # Bind mount for live updates
environment:
- FASTAPI_ENV=production

0 comments on commit 3620626

Please sign in to comment.