-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
80 lines (75 loc) · 2.1 KB
/
docker-compose.yml
File metadata and controls
80 lines (75 loc) · 2.1 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
x-application-service: &application-service
build:
context: ./
dockerfile: Dockerfile
stdin_open: true
tty: true
depends_on:
mariadb:
condition: service_healthy
environment:
DJANGO_SETTINGS_MODULE: qsts3.settings
DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY:-django-insecure-2ir3a7tRpdDNBdymZYdmvQ61Qv1gJF9CyUoxkZcQHqg}
QSTS_DEBUG: ${QSTS_DEBUG:-True}
LOG_LEVEL: ${LOG_LEVEL:-}
DB_NAME: ${DB_NAME:-quickstatements}
DB_USER: ${DB_USER:-root}
DB_PASSWORD: ${DB_PASSWORD:-quickstatements_pass}
DB_HOST: ${DB_HOST:-mariadb}
STATIC_ROOT: ${STATIC_ROOT:-/root/www/python/static}
OAUTH_AUTHORIZATION_SERVER: ${OAUTH_AUTHORIZATION_SERVER:-https://test.wikidata.org}
DEFAULT_WIKIBASE_URL: ${DEFAULT_WIKIBASE_URL:-https://test.wikidata.org}
env_file:
- ./.env
volumes:
- ./src:/root/www/python/src
- ./translations:/root/www/python/translations
- qs-static-data:/root/www/python/static
services:
mariadb:
image: mariadb:11.7.2
environment:
MARIADB_DATABASE: ${DB_NAME:-quickstatements}
MARIADB_ROOT_PASSWORD: ${DB_PASSWORD:-quickstatements_pass}
volumes:
- qs-mariadb-data:/var/lib/mysql
healthcheck:
test: healthcheck.sh --connect --innodb_initialized
start_period: 10s
interval: 10s
timeout: 5s
retries: 3
nginx:
image: nginx
ports:
- "8000:80"
volumes:
- qs-static-data:/static
- ./etc/nginx.conf:/etc/nginx/nginx.conf
depends_on:
app:
condition: service_healthy
app:
<<: *application-service
command: >
/bin/bash -c "
django-admin collectstatic --no-input &&
django-admin translate &&
django-admin migrate &&
django-admin runserver 0.0.0.0:8000
"
healthcheck:
test: curl --fail http://localhost:8000/ || exit 1
start_period: 10s
interval: 10s
timeout: 5s
retries: 3
send_batches:
<<: *application-service
command: django-admin send_batches
depends_on:
app:
condition: service_healthy
volumes:
qs-mariadb-data:
qs-static-data: