-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
52 lines (48 loc) · 1.27 KB
/
docker-compose.yml
File metadata and controls
52 lines (48 loc) · 1.27 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
services:
db:
image: mysql:8
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-kaitix}
MYSQL_DATABASE: ${MYSQL_DATABASE:-kaitix}
MYSQL_USER: ${MYSQL_USER:-kaitix}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-kaitix}
volumes:
- db_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-p${MYSQL_PASSWORD:-kaitix}"]
interval: 10s
timeout: 5s
retries: 10
backend:
build:
context: .
dockerfile: Dockerfile.backend
restart: unless-stopped
environment:
DATABASE_URL: ${DATABASE_URL:-mysql+aiomysql://kaitix:kaitix@db:3306/kaitix}
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-http://localhost}
depends_on:
db:
condition: service_healthy
command: >
sh -c "python -m alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 8003"
frontend:
build:
context: .
dockerfile: Dockerfile.frontend
restart: unless-stopped
environment:
ORIGIN: http://localhost
proxy:
image: nginx:alpine
restart: unless-stopped
ports:
- "80:80"
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- backend
- frontend
volumes:
db_data: