forked from kartoza/geodata-mart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
production.yml
133 lines (121 loc) · 3.1 KB
/
production.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
122
123
124
125
126
127
128
129
130
131
132
133
version: "3"
# Common Django template for GeoNode and Celery services below
x-common-django:
&default-common-django
image: ${COMPOSE_PROJECT_NAME}_django
restart: on-failure
env_file:
- .env
volumes:
- ./geodata:/qgis:z
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
services:
traefik:
build:
context: .
dockerfile: ./docker/production/traefik/Dockerfile
image: traefik
depends_on:
- django
volumes:
- traefik:/etc/traefik/acme:z
ports:
- "0.0.0.0:80:80"
- "0.0.0.0:443:443"
- "0.0.0.0:5555:5555"
- "0.0.0.0:9000:9000"
- "0.0.0.0:9001:9001"
django:
<<: *default-common-django
build:
context: .
dockerfile: ./docker/production/Dockerfile
container_name: django4${COMPOSE_PROJECT_NAME}
platform: linux/x86_64
command: /start
postgres:
image: kartoza/postgis:${POSTGRES_MAJOR_VERSION}-${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_RELEASE}
volumes:
- db-data:/var/lib/postgresql
- db-backups:/backups
env_file:
- .env
restart: on-failure
healthcheck:
test: "exit 0"
dbbackups:
image: kartoza/pg-backup:${POSTGRES_MAJOR_VERSION}-${POSTGIS_MAJOR_VERSION}.${POSTGIS_MINOR_RELEASE}
hostname: pg-backups
volumes:
- db-backups:/backups
environment:
- DUMPPREFIX=PG_db
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASS=${POSTGRES_PASS}
- POSTGRES_PORT=${POSTGRES_SERVICE_PORT}
- POSTGRES_HOST=${POSTGRES_HOST}
- POSTGRES_DBNAME=${POSTGRES_DB}
- REMOVE_BEFORE=30
restart: on-failure
depends_on:
postgres:
condition: service_healthy
redis:
image: redis:6
container_name: redis
healthcheck:
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
interval: 1s
timeout: 3s
retries: 5
celeryworker:
build:
context: .
dockerfile: ./docker/production/CeleryWorker
platform: linux/x86_64
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
volumes:
- ./geodata:/qgis:z
env_file:
- .env
command: /start-celeryworker
deploy:
mode: replicated
replicas: 6
celerybeat:
<<: *default-common-django
image: ${COMPOSE_PROJECT_NAME}_django
container_name: celerybeat${COMPOSE_PROJECT_NAME}
command: /start-celerybeat
restart: unless-stopped
flower:
<<: *default-common-django
image: ${COMPOSE_PROJECT_NAME}_django
container_name: flower${COMPOSE_PROJECT_NAME}
depends_on:
- celerybeat
command: /start-flower
minio:
image: quay.io/minio/minio
environment:
- MINIO_ROOT_USER=${DJANGO_AWS_ACCESS_KEY_ID}
- MINIO_ROOT_PASSWORD=${DJANGO_AWS_SECRET_ACCESS_KEY}
entrypoint: /bin/bash
command: -c 'minio server /data --console-address ":9001"'
volumes:
- minio-data:/data
healthcheck:
test: "curl -I http://localhost:9000/minio/health/live"
volumes:
traefik: null
db-data: null
db-backups: null
minio-data: null