-
Notifications
You must be signed in to change notification settings - Fork 10
/
docker-compose.yml
96 lines (90 loc) · 2.76 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
services:
db:
# NOTE: No persistance storage configured.
# See: https://hub.docker.com/_/postgres/
image: postgis/postgis:12-2.5
environment:
- POSTGRES_USER=${DB_USER:-objects}
- POSTGRES_PASSWORD=${DB_PASSWORD:-objects}
redis:
image: redis:7
command: ["redis-server", "--appendonly", "yes"]
web:
image: maykinmedia/objects-api:latest
build: &web_build
context: .
environment: &web_env
- DJANGO_SETTINGS_MODULE=objects.conf.docker
- SECRET_KEY=${SECRET_KEY:-1(@f(-6s_u(5fd&1sg^uvu2s(c-9sapw)1era8q&)g)h@cwxxg}
- IS_HTTPS=no
- ALLOWED_HOSTS=*
- CACHE_DEFAULT=redis:6379/0
- CACHE_AXES=redis:6379/0
- CELERY_BROKER_URL=redis://redis:6379/1
- CELERY_RESULT_BACKEND=redis://redis:6379/1
- CELERY_LOGLEVEL=DEBUG
- DISABLE_2FA=${DISABLE_2FA:-yes}
- SUBPATH=${SUBPATH}
# setup_configuration env vars
- SITES_CONFIG_ENABLE=yes
- OBJECTS_DOMAIN=web:8000
- OBJECTS_ORGANIZATION=Objects
- OBJECTS_OBJECTTYPES_CONFIG_ENABLE=false
# - OBJECTTYPES_API_ROOT=https://objecttypes.example.com/api/v2/
- OBJECTS_OBJECTTYPES_TOKEN=some-random-string
- DEMO_CONFIG_ENABLE=yes
- DEMO_TOKEN=demo-random-string
- DEMO_PERSON=Demo
healthcheck:
test: ["CMD", "python", "-c", "import requests; exit(requests.head('http://localhost:8000/admin/').status_code not in [200, 302])"]
interval: 30s
timeout: 5s
retries: 3
# This should allow for enough time for migrations to run before the max
# retries have passed. This healthcheck in turn allows other containers
# to wait for the database migrations.
start_period: 30s
ports:
- 8000:8000
depends_on:
web-init:
condition: service_completed_successfully
volumes: &web_volumes
- media:/app/media # Shared media volume to get access to saved OAS files
web-init:
image: maykinmedia/objects-api:latest
build: *web_build
environment: *web_env
command: /setup_configuration.sh
depends_on:
- db
- redis
volumes: *web_volumes
celery:
image: maykinmedia/objects-api:latest
build: *web_build
environment: *web_env
command: /celery_worker.sh
healthcheck:
test: ["CMD", "python", "/app/bin/check_celery_worker_liveness.py"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
depends_on:
web:
condition: service_healthy
volumes: *web_volumes
celery-flower:
image: maykinmedia/objects-api:latest
build: *web_build
environment: *web_env
command: /celery_flower.sh
ports:
- 5555:5555
depends_on:
- redis
- celery
volumes:
media: