-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
27 lines (24 loc) · 1.42 KB
/
docker-compose.yml
File metadata and controls
27 lines (24 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# docker-compose.yml — used for local development
# This file extends the production setup to build images locally instead of pulling from Docker Hub
# It also adds developer-friendly options for easier debugging and testing
services:
backend: # Backend service — Flask API
build: ./backend # Build the Docker image from the local 'backend' directory using its Dockerfile
container_name: flask-api # Name the container for easier debugging and referencing
expose:
- 5000 # Expose port 5000 to other containers (not accessible directly from the host machine)
frontend: # Frontend service — Node.js app
build: ./frontend # Build the Docker image from the local 'frontend' directory
container_name: node-frontend # Name the container for clarity
expose:
- 3000 # Expose port 3000 for internal access within the Docker network
nginx: # Nginx service — acts as a reverse proxy
image: nginx:alpine # Use the lightweight Alpine-based nginx image
container_name: nginx-proxy # Set container name for easier management
ports:
- "80:80" # Map port 80 from container to host so the app is reachable via browser (http://localhost)
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro # Mount the local nginx configuration file as read-only
depends_on: # Ensure nginx starts only after backend and frontend containers are ready
- backend
- frontend