-
Notifications
You must be signed in to change notification settings - Fork 9
/
docker-compose.yml
executable file
·180 lines (172 loc) · 4.99 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
version: "3.9"
volumes:
postgres_data:
certificates:
static-data:
media-data:
minio_images:
services:
db:
image: kartoza/postgis:16-3.4
volumes:
- postgres_data:/var/lib/postgresql
environment:
- POSTGRES_DB=${POSTGIS_DB:-minisass_data}
- POSTGRES_USER=${POSTGRES_USER:-docker}
- POSTGRES_PASS=${POSTGRES_PASS:-docker}
- ALLOW_IP_RANGE=${ALLOW_IP_RANGE:-0.0.0.0/0}
- POSTGRES_MULTIPLE_EXTENSIONS=${POSTGRES_MULTIPLE_EXTENSIONS:-postgis,hstore,postgis_topology,postgis_raster,pgrouting}
- FORCE_SSL=${FORCE_SSL:-FALSE}
ports:
- "32769:5432"
restart: always
healthcheck:
test: "PGPASSWORD=${POSTGRES_PASS} pg_isready -h 127.0.0.1 -U ${POSTGRES_USER} -d minisass_data"
interval: 5s
timeout: 10s
retries: 30
minio:
image: quay.io/minio/minio
environment:
- MINIO_ROOT_USER=${MINIO_ROOT_USER}
- MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD}
entrypoint: /bin/bash
command: -c 'minio server /data --console-address ":9001"'
volumes:
- minio_images:/data
ports:
- "9000:9000"
- "9001:9001"
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:9000/minio/health/live" ]
interval: 30s
timeout: 20s
retries: 3
createbuckets:
image: minio/mc
depends_on:
minio:
condition: service_started
entrypoint: >
/bin/sh -c "
/usr/bin/mc config host add minisass http://minio:9000 ${MINIO_ROOT_USER} ${MINIO_ROOT_PASSWORD};
/usr/bin/mc rm -r --force minisass/${BUCKET};
/usr/bin/mc mb minisass/${BUCKET};
/usr/bin/mc policy download minisass/${BUCKET};
exit 0;
"
mount:
image: kartoza/s3mount
build:
context: deployment/docker-s3-bucket
privileged: true
environment:
- AWS_ACCESS_KEY=${MINIO_ROOT_USER}
- AWS_SECRET_ACCESS_KEY=${MINIO_ROOT_PASSWORD}
- S3_MOUNT_DIRECTORY=/web
- S3_BUCKET_NAME=${BUCKET}
# URL can be an amazon S3 bucket so that we can mount it
- MINIO_URL=http://minio:9000/
volumes:
- minio_images:/web
depends_on:
minio:
condition: service_started
django:
build:
context: .
dockerfile: ./deployment/docker/Dockerfile
volumes:
- static-data:/home/web/static
- media-data:/home/web/media
- ./django_project:/home/web/django_project
# Images on the platform will be stored here
- minio_images:/home/web/minio
environment:
- AWS_ACCESS_KEY=${MINIO_ROOT_USER:-minisass_admin}
- AWS_SECRET_ACCESS_KEY=${MINIO_ROOT_PASSWORD:-secure_minio_secret}
- DJANGO_DB=${POSTGRES_DB:-minisass_data}
- POSTGRES_USER=${POSTGRES_USER:-docker}
- POSTGRES_PASS=${POSTGRES_PASS:-docker}
- DATABASE_HOST=${DATABASE_HOST:-db}
- DATABASE_PORT=${DATABASE_PORT:-5432}
- SENTRY_KEY=${SENTRY_KEY:-}
- MINIO_ROOT=/home/web/minio
- MINIO_BUCKET=${BUCKET:-demo}
- MINIO_ACCESS_KEY=${MINIO_ROOT_USER:-minisass_admin}
- MINIO_SECRET_KEY=${MINIO_ROOT_PASSWORD:-secure_minio_secret}
- MINIO_AI_BUCKET=${BUCKET}
- MINIO_ENDPOINT=${MINIO_URL:-http://minio:9000}
- MINIO_URL=${MINIO_URL:-http://minio:9000}
- ALLOWED_HOSTS='*'
- DEV_SETUP=${DEV_SETUP}
depends_on:
db:
condition: service_healthy
restart: always
ports:
- "8080"
logging:
driver: json-file
options:
max-size: 200m
max-file: '10'
letsencrypt:
build: ./deployment/letsencrypt/
environment:
- HTTPS_HOST=${HTTPS_HOST}
- HTTP_HOST=${HTTP_HOST}
- ADMIN_EMAIL=${ADMIN_EMAIL}
- LETSENCRYPT_MODE=${LETSENCRYPT_MODE}
volumes:
- certificates:/certificates/
restart: always
tiles:
image: pramsey/pg_tileserv
volumes:
- ./deployment/config/pg_tileserv.toml:/etc/pg_tileserv.toml
restart: always
environment:
- DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASS}@${DATABASE_HOST}/${POSTGRES_DB}
- TS_URLBASE=${VECTOR_TILES_URL}
- TS_BASEPATH=/tiles
depends_on:
db:
condition: service_healthy
healthcheck:
test: curl --fail -s http://localhost:9000/ || exit 1
interval: 1m30s
timeout: 10s
retries: 3
logging:
driver: json-file
options:
max-size: 200m
max-file: '10'
web:
image: nginx
hostname: nginx
environment:
- HTTPS_HOST=${HTTPS_HOST}
- HTTP_HOST=${HTTP_HOST}
- HTTPS_PORT=${HTTPS_PORT}
- HTTP_PORT=${HTTP_PORT}
- LETSENCRYPT_MODE=${LETSENCRYPT_MODE}
- RESOLVER=${RESOLVER}
ports:
- "61122:80"
volumes:
- ./deployment/nginx/sites-enabled:/etc/nginx/conf.d:ro
- static-data:/home/web/static
- media-data:/home/web/media
- minio_images:/home/web/minio
- certificates:/certificates/
restart: on-failure
depends_on:
- django
- db
logging:
driver: json-file
options:
max-size: 200m
max-file: '10'