-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-development.yml
117 lines (105 loc) · 4.07 KB
/
docker-development.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
# fragment for development setups
# https://docs.docker.com/compose/extends/
x-dev-django:
&dev-django
image: git.ubuntu-eu.org/ubuntuusers/inyokaproject:staging
user: root:root
configs:
- source: inyoka-dev-config
target: /inyoka/code/development_settings.py
volumes:
- ./theme-ubuntuusers:/inyoka/theme
- ./inyoka:/inyoka/code
x-dev-env:
&dev-env
INYOKA_GID: 100
INYOKA_UID: 1000
DJANGO_SETTINGS_MODULE: development_settings
services:
inyoka-worker:
<< : *dev-django
environment:
<< : *dev-env
extra_hosts:
- "ubuntuusers.localhost:127.0.0.1"
- "forum.ubuntuusers.localhost:127.0.0.1"
- "paste.ubuntuusers.localhost:127.0.0.1"
- "wiki.ubuntuusers.localhost:127.0.0.1"
- "planet.ubuntuusers.localhost:127.0.0.1"
- "ikhaya.ubuntuusers.localhost:127.0.0.1"
- "static.ubuntuusers.localhost:127.0.0.1"
- "media.ubuntuusers.localhost:127.0.0.1"
command: >
sh -c "
/inyoka/venv/bin/pip install --no-deps --require-hashes -r extra/requirements/development.txt &&
/inyoka/venv/bin/python manage.py migrate &&
chown $$INYOKA_UID:$$INYOKA_GID inyoka.log celery.log /srv/www/media &&
setpriv --reuid=$$INYOKA_UID --regid=$$INYOKA_GID --clear-groups /inyoka/venv/bin/gunicorn -b 0.0.0.0:8000 --reload --workers 1 inyoka.wsgi:application"
celeryworker:
<< : *dev-django
environment:
<<: *dev-env
command: >
sh -c "
/inyoka/venv/bin/pip install --no-deps --require-hashes -r extra/requirements/development.txt &&
chown $$INYOKA_UID:$$INYOKA_GID inyoka.log celery.log &&
setpriv --reuid=$$INYOKA_UID --regid=$$INYOKA_GID --clear-groups /inyoka/venv/bin/celery --app=inyoka worker --loglevel=INFO --concurrency=8"
celerybeat:
<< : *dev-django
environment:
<<: *dev-env
command: >
sh -c "
/inyoka/venv/bin/pip install --no-deps --require-hashes -r extra/requirements/development.txt &&
chown $$INYOKA_UID:$$INYOKA_GID inyoka.log celery.log /volume/celerybeat-schedule/ &&
setpriv --reuid=$$INYOKA_UID --regid=$$INYOKA_GID --clear-groups /inyoka/venv/bin/celery --app=inyoka beat --pidfile /tmp/celerybeat.pid --loglevel=INFO --schedule /tmp/celerybeat-schedule"
build_statics_theme:
image: git.ubuntu-eu.org/ubuntuusers/inyokaproject:staging
user: root:root
environment:
<<: *dev-env
working_dir: /inyoka/theme
command: >
sh -c "
apt-get update &&
apt-get install -y --no-install-recommends nodejs npm inotify-tools &&
npm install &&
setpriv --reuid=$$INYOKA_UID --regid=$$INYOKA_GID --clear-groups npm run watch"
volumes:
- ./theme-ubuntuusers:/inyoka/theme
copy_statics:
<< : *dev-django
environment:
<<: *dev-env
command: >
sh -c "
apt-get update &&
apt-get install -y --no-install-recommends inotify-tools &&
/inyoka/venv/bin/pip install --no-deps --require-hashes -r extra/requirements/development.txt &&
chown $$INYOKA_UID:$$INYOKA_GID inyoka.log celery.log &&
setpriv --reuid=$$INYOKA_UID --regid=$$INYOKA_GID --clear-groups bash -c 'while true; do /inyoka/venv/bin/python manage.py collectstatic --noinput --clear; inotifywait --quiet --recursive --event modify /inyoka/theme/inyoka_theme_ubuntuusers/static/; done'"
volumes:
- ./theme-ubuntuusers:/inyoka/theme:ro
- ./inyoka/inyoka/static-collected:/inyoka/code/inyoka/static-collected
configs:
- source: inyoka-config
target: /inyoka/code/production_settings.py
- source: inyoka-dev-config
target: /inyoka/code/development_settings.py
- inyoka-base-domain
- inyoka-media-domain
- inyoka-static-domain
secrets:
- inyoka-postgres-password
- inyoka-redis-password
- inyoka-secret-key
- inyoka-akismet-key
- inyoka-sentry-dsn
caddy:
image: git.ubuntu-eu.org/ubuntuusers/caddy-inyoka:staging
volumes:
- ./inyoka/inyoka/static-collected:/srv/www/static/:ro
configs:
inyoka-dev-config:
file: ./development_settings.py
template_driver: golang