-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
42 lines (39 loc) · 957 Bytes
/
docker-compose.yml
File metadata and controls
42 lines (39 loc) · 957 Bytes
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
services:
fastapi:
build:
context: .
dockerfile: app/Dockerfile
entrypoint: sh -c "uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload"
ports:
- "8000:8000"
volumes:
- ./app:/app
- static_volume:/app/static
- media_volume:/app/media
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8000/healthcheck || exit 1"]
interval: 5s
timeout: 5s
retries: 3
depends_on:
- mysql
mysql:
image: mysql:8.0
volumes:
- mysql_volume:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_PORT: ${DB_PORT}
ports:
- "${DB_PORT}:3306"
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 20s
retries: 5
volumes:
mysql_volume:
static_volume:
media_volume: