-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.reference.yml
74 lines (69 loc) · 1.64 KB
/
docker-compose.reference.yml
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
version: "3"
services:
climsoft_api:
image: climsoft_api:0.1.0
build:
context: .
dockerfile: Dockerfile
container_name: climsoft_api
ports:
- "5080:5000"
environment:
- CLIMSOFT_SECRET_KEY=change-me
- CLIMSOFT_DATABASE_URI=mysql+mysqldb://root:password@mariadb:3306/climsoft
env_file:
- .env
depends_on:
- mariadb
volumes:
- ./climsoft_uploads:/climsoft_uploads
networks:
- climsoft_api_dev_network
labels:
- "traefik.enable=true"
- "traefik.http.routers.fastapi.rule=Host(`$HOST_FQDN`)"
- "traefik.http.routers.fastapi.tls=true"
- "traefik.http.routers.fastapi.tls.certresolver=letsencrypt"
command:
[
"uvicorn",
"climsoft_api.main:app",
"--host",
"0.0.0.0",
"--port",
"5000",
"--reload",
"--use-colors",
]
mariadb:
build:
context: .
dockerfile: Dockerfile.mariadb
container_name: mariadb
ports:
- "23306:3306"
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_DATABASE=climsoft
networks:
- climsoft_api_dev_network
volumes:
- climsoftdb_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
retries: 10
interval: 10s
traefik:
image: traefik:latest
ports:
- "80:80"
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "$PWD/traefik/traefik.toml:/etc/traefik/traefik.toml"
networks:
- climsoft_api_dev_network
volumes:
climsoftdb_data:
networks:
climsoft_api_dev_network: