-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
78 lines (72 loc) · 1.7 KB
/
docker-compose.yml
File metadata and controls
78 lines (72 loc) · 1.7 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
services:
api: &main_app
build:
context: .
dockerfile: ./Dockerfile
image: fastapi-base-framework:${APP_VERSION:-latest}
restart: always
env_file:
- .env
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
environment:
HOST: 0.0.0.0
DB_HOST: fastapi-base-db
DB_PORT: 3306
DB_USER: fastapi_user
DB_PASSWORD: fastapi_password
DB_BASE: fastapi_base
REDIS_HOST: fastapi-base-redis
db:
image: mysql:8.4
hostname: fastapi-base-db
restart: always
environment:
MYSQL_ROOT_USER: "root"
MYSQL_ROOT_PASSWORD: "fastapi_password"
MYSQL_USER: "fastapi_user"
MYSQL_PASSWORD: "fastapi_password"
MYSQL_DATABASE: "fastapi_base"
MYSQL_HOST: "0.0.0.0"
healthcheck:
test:
- CMD
- mysqladmin
- ping
- --user=fastapi_user
- --password=fastapi_password
interval: 10s
timeout: 5s
retries: 40
volumes:
- "fastapi-base-db-data:/var/lib/mysql"
migrator:
image: fastapi-base-framework:${APP_VERSION:-latest}
restart: "no"
command: aerich upgrade
environment:
DB_HOST: fastapi-base-db
DB_PORT: 3306
DB_USER: fastapi_user
DB_PASSWORD: fastapi_password
DB_BASE: fastapi_base
depends_on:
db:
condition: service_healthy
redis:
image: bitnami/redis:6.2.5
hostname: "fastapi-base-redis"
restart: always
environment:
ALLOW_EMPTY_PASSWORD: "yes"
healthcheck:
test: redis-cli ping
interval: 1s
timeout: 3s
retries: 50
volumes:
fastapi-base-db-data:
name: fastapi-base-db-data