-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
34 lines (32 loc) · 1.41 KB
/
docker-compose.yml
File metadata and controls
34 lines (32 loc) · 1.41 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
28
29
30
31
32
33
34
# Version of the Docker Compose file format
version: '3.8'
# Define the services (containers) that make up your application
services:
# Backend service for your Flask application
backend:
build: ./backend # Build the image using the Dockerfile in the ./backend directory
ports:
- "5000:5000" # Map host port 5000 to container port 5000
volumes:
- ./backend:/app # Mount the local backend directory into the container
environment:
# These variables are set in the Dockerfile as well, but can be overridden here
FLASK_APP: app.py
FLASK_RUN_HOST: 0.0.0.0
FLASK_ENV: development
# Ensure the backend starts before the frontend tries to connect
depends_on:
- frontend # This ensures backend starts after frontend, but frontend needs to proxy requests to backend.
# For actual health checks, use 'healthcheck' block.
# Given the current setup, the Nginx proxy handles the connection.
# Frontend service for your HTML/JavaScript
frontend:
build: ./frontend # Build the image using the Dockerfile in the ./frontend directory
ports:
- "80:80" # Map host port 80 to container port 80
volumes:
- ./frontend:/usr/share/nginx/html # Mount the local frontend directory to Nginx's web root
# Ensures the frontend can access the backend service by its name 'backend'
# within the Docker network
links:
- backend