-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
121 lines (112 loc) · 2.92 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
version: "3"
name: tasking-manager-main
volumes:
tm_db_data:
name: tm-db-data-main
networks:
tm-net:
name: tm-net
services:
tm-db:
image: "postgis/postgis:16-3.4"
volumes:
- tm_db_data:/var/lib/postgresql/data/
env_file:
- tasking-manager.env
restart: unless-stopped
healthcheck:
test: pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}
start_period: 35s
interval: 10s
timeout: 5s
retries: 3
networks:
- tm-net
tm-backend:
image: ghcr.io/hotosm/tasking-manager/backend:main
build:
context: .
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:8000 || 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(`127.0.0.1`) || Host(`localhost`)) && PathPrefix(`/api/`)
- traefik.http.services.backend.loadbalancer.server.port=8000
networks:
- tm-net
# tm-migration:
# image: ghcr.io/hotosm/tasking-manager/backend:main
# build:
# context: .
# 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/hotosm/tasking-manager/frontend:main
build:
context: .
dockerfile: "./scripts/docker/Dockerfile.frontend_development"
env_file:
- tasking-manager.env
labels:
- traefik.http.routers.frontend.rule=Host(`127.0.0.1`) || Host(`localhost`)
- traefik.http.services.frontend.loadbalancer.server.port=3000
networks:
- tm-net