-
-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
122 lines (112 loc) · 2.57 KB
/
docker-compose.yml
File metadata and controls
122 lines (112 loc) · 2.57 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
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
122
volumes:
postgres_data:
files_data:
x-app-env: &app-env
DATABASE_URL: postgresql://postgres:postgres@db/skylines
REDIS_URL: redis://redis:6379/0
SKYLINES_CONFIG: /home/skylines/code/config/docker.py
PGHOST: db
PGUSER: postgres
PGPASSWORD: postgres
x-app: &app
build: .
environment:
<<: *app-env
C_FORCE_ROOT: "1"
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
restart: on-failure
services:
db:
image: postgis/postgis:12-2.5
volumes:
- ./docker/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: pg_isready -U postgres
interval: 5s
timeout: 5s
retries: 10
redis:
image: redis:8-alpine
healthcheck:
test: redis-cli ping
interval: 5s
timeout: 5s
retries: 10
migrate:
<<: *app
command: >
sh -c "python manage.py migrate upgrade 2>/dev/null || python manage.py db create"
restart: "no"
api:
<<: *app
ports:
- "5000:5000"
volumes:
- files_data:/home/skylines/code/htdocs/files
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
migrate:
condition: service_completed_successfully
healthcheck:
test: ["CMD", "curl", "-sf", "-A", "healthcheck", "http://localhost:5000/"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
worker:
<<: *app
command: python manage.py celery runworker
volumes:
- files_data:/home/skylines/code/htdocs/files
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
migrate:
condition: service_completed_successfully
tracking:
<<: *app
command: python manage.py tracking runserver
ports:
- "5597:5597/udp"
depends_on:
db:
condition: service_healthy
migrate:
condition: service_completed_successfully
mapproxy:
<<: *app
command: >
gunicorn
--bind 0.0.0.0:9109
--workers 4
--timeout 120
wsgi_mapproxy:application
expose:
- "9109"
depends_on:
db:
condition: service_healthy
migrate:
condition: service_completed_successfully
caddy:
image: caddy:2-alpine
ports:
- "80:80"
volumes:
- ./docker/Caddyfile:/etc/caddy/Caddyfile:ro
depends_on:
api:
condition: service_healthy