forked from hotosm/tasking-manager
-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
105 lines (98 loc) · 2.59 KB
/
docker-compose.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: tasking-manager-main
networks:
tm-net:
name: tm-net
services:
tm-db:
image: "mdillon/postgis:11"
volumes:
- /srv/postgresql:/var/lib/postgresql/data
env_file: tasking-manager.env
restart: unless-stopped
healthcheck:
test: pg_isready -U ${POSTGRES_USER}
start_period: 35s
interval: 10s
timeout: 5s
retries: 3
networks:
- tm-net
tm-backend:
image: ghcr.io/osmitalia/osmit-tm-backend:v4.8
depends_on:
tm-db:
condition: service_healthy
tm-migration:
condition: service_completed_successfully
env_file: tasking-manager.env
restart: unless-stopped
healthcheck:
test: curl --fail http://localhost:5000 || exit 1
interval: 10s
retries: 5
start_period: 10s
timeout: 3s
deploy:
replicas: ${API_REPLICAS:-1}
resources:
limits:
cpus: "1"
memory: 1500M
reservations:
cpus: "1"
memory: 100M
labels:
- traefik.http.routers.backend.rule=Host(`osmit-tm4.wmcloud.org`) && PathPrefix(`/api/`)
- traefik.http.services.backend.loadbalancer.server.port=5000
networks:
- tm-net
tm-migration:
image: ghcr.io/osmitalia/osmit-tm-backend:v4.8
entrypoint: ["python", "manage.py", "db", "upgrade"]
depends_on:
tm-db:
condition: service_healthy
env_file: tasking-manager.env
deploy:
replicas: ${API_REPLICAS:-1}
resources:
limits:
cpus: "1"
memory: 1500M
reservations:
cpus: "1"
memory: 100M
networks:
- tm-net
swagger:
image: swaggerapi/swagger-ui:v5.11.10
restart: always
environment:
- BASE_URL=/docs
- SWAGGER_JSON_URL=http://127.0.0.1:${TM_DEV_PORT:-3000}/api/v2/system/docs/json/
labels:
- traefik.http.routers.swagger.rule=(Host(`127.0.0.1`) || Host(`localhost`)) && PathPrefix(`/docs/`)
- traefik.http.services.swagger.loadbalancer.server.port=8080
networks:
- tm-net
traefik:
image: traefik:v2.10
restart: always
ports:
- "${TM_DEV_PORT:-3000}:80"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
command:
- --entrypoints.web.address=:80
- --providers.docker=true
networks:
- tm-net
tm-frontend:
image: ghcr.io/osmitalia/osmit-tm-frontend:v4.8
env_file:
- tasking-manager.env
labels:
- traefik.http.routers.frontend.rule=Host(`osmit-tm4.wmcloud.org`)
- traefik.http.services.frontend.loadbalancer.server.port=3000
networks:
- tm-net