-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
81 lines (76 loc) · 1.74 KB
/
docker-compose.yml
File metadata and controls
81 lines (76 loc) · 1.74 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
version: '3.8'
services:
mongodb:
image: mongo:latest
container_name: ddfr_mongodb
restart: unless-stopped
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
environment:
MONGO_INITDB_DATABASE: ddfr_db
networks:
- ddfr_network
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: ddfr_backend
restart: unless-stopped
ports:
- "8000:8000"
volumes:
- ./backend/app/.env:/app/app/.env:ro
- backend_logs:/app/app/logs
- backend_img:/app/app/img
environment:
# Override DB_URL per usare il nome del servizio Docker
DB_URL: mongodb://mongodb:27017/
DB_NAME: ddfr_db
DB_COLLECTION: people
depends_on:
mongodb:
condition: service_healthy
networks:
- ddfr_network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
# Variabili per il build React (incorporate nel bundle)
REACT_APP_WS_PROTOCOL: ws
REACT_APP_WS_HOST: localhost
REACT_APP_WS_PORT: 8000
container_name: ddfr_frontend
restart: unless-stopped
ports:
- "3000:3000"
depends_on:
backend:
condition: service_healthy
networks:
- ddfr_network
networks:
ddfr_network:
driver: bridge
volumes:
mongodb_data:
driver: local
backend_logs:
driver: local
backend_img:
driver: local