-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
71 lines (66 loc) · 1.66 KB
/
Copy pathdocker-compose.yml
File metadata and controls
71 lines (66 loc) · 1.66 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
# Orchestration to connect Nextjs, Flask, and MySQL
services:
db:
container_name: qualisync-db
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
volumes:
- db-data:/var/lib/mysql
- ./server/db/migrations:/docker-entrypoint-initdb.d:ro
ports:
- "3307:3306"
restart: unless-stopped
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-uroot", '--password=$${MYSQL_ROOT_PASSWORD}']
interval: 10s
timeout: 5s
retries: 10
start_period: 10s
networks:
- default
backend:
container_name: qualisync-api
build: ./server
ports:
- 5821:5821
env_file:
- ./server/.env
environment:
- DB_HOST=db
- DB_PORT=3306
- FLASK_API_HOST=${FLASK_API_HOST}
- FLASK_API_PORT=${FLASK_API_PORT}
volumes:
- ./server/db:/app/db
depends_on:
db:
condition: service_healthy
healthcheck:
# RECOMMENDED HEALTH CHECK - add dedicated /health endpoint
test: ["CMD-SHELL", "curl -f http://$${FLASK_API_HOST}:$${FLASK_API_PORT}/ || exit 1"]
interval: 1m30s
timeout: 30s
retries: 5
start_period: 30s
networks:
- default
frontend:
container_name: qualisync-web
build: ./web
ports:
- 3000:3000
env_file:
- ./web/.env
environment:
- NEXT_PUBLIC_FLASK_API_URL=http://backend:5821
- FLASK_API_URL=http://backend:5821
depends_on:
- backend
networks:
- default
volumes:
db-data: {}