-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcompose.yaml
116 lines (112 loc) · 5 KB
/
compose.yaml
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
services:
frontend: # Enables hot reload of code changes
build:
context: .
dockerfile: docker/Dockerfile
target: frontend
command:
npm run watch-sass
volumes:
- .:/code/
# NOTE: We do not want node_modules on the host machine, so we
# create an additional volume for it. It is important this anonymous
# volume comes after the above bind to work.
- /code/nodejs/node_modules/
os2borgerpc-admin:
environment:
DB_HOST: db
DB_NAME: bpc
DB_USER: bpc
DB_PASSWORD: bpc
DB_PORT: ""
ALLOWED_HOSTS: "*"
CORE_SCRIPT_COMMIT_HASH: db319672efdcc0f7402c4a7370aa763be9960c38
CORE_SCRIPT_VERSION_TAG: v0.1.4
PC_IMAGE_RELEASES_URL: https://github.com/OS2borgerPC/os2borgerpc-image/releases
KIOSK_IMAGE_RELEASES_URL: https://github.com/OS2borgerPC/os2borgerpc-kiosk-image/releases
DEBUG: True
SECRET_KEY: v3rys1kr3t
# Admin contact - fill in your own name and email as desired.
ADMIN_USERNAME: admin
ADMIN_EMAIL: [email protected]
ADMIN_PASSWORD: admin
# Timezone/Language
TIME_ZONE: Europe/Copenhagen
LANGUAGE_CODE: da-dk
INITIALIZE_DATABASE: True
LOG_LEVEL: INFO
# IF USING THE CICERO INTEGRATION
CICERO_URL: CICERO_SERVER_HERE
# This particular line makes it both skip the connection to the Cicero server AND the validation of the username/password
# For that reason, depending on what you're testing, you might want to comment out this line
CITIZEN_LOGIN_API_VALIDATOR: system.utils.always_validate_citizen
build:
context: .
dockerfile: docker/Dockerfile
target: os2borgerpc
# NOTE: --workers 1 and --max-requests 1 makes gunicorn run with only
# one worker + respawn it after each request to reload on changes
# to templates/CSS + avoid issues where different workers have cached
# different versions of files so one cycles between seeing different
# codebase versions on browser refresh!
# --reload by itself only reloads on changes to python files
# Another option is reload-extra-file on every template and CSS file,
# but ATM it's apparently not recursive, so a solution like this would
# be needed:
# https://github.com/benoitc/gunicorn/pull/1846#issuecomment-1862496443
# Open PR to make --reload-extra-file recursive:
# https://github.com/benoitc/gunicorn/pull/1846
command:
sh -c "python manage.py initialize_database &&
python manage.py compilemessages &&
gunicorn --reload --workers 1 --max-requests 1
--reload-extra-file /code/admin_site/locale/da/LC_MESSAGES/django.mo
--reload-extra-file /code/admin_site/locale/da/LC_MESSAGES/djangojs.mo
--reload-extra-file /code/admin_site/locale/sv/LC_MESSAGES/django.mo
--reload-extra-file /code/admin_site/locale/sv/LC_MESSAGES/djangojs.mo
--timeout 0 --config /code/docker/gunicorn-settings.py os2borgerpc_admin.wsgi &
gunicorn --bind 0.0.0.0:8080 os2borgerpc_admin.jobsWsgi"
volumes:
- .:/code/
- scripts:/media
# Use below to add test data (PC's, scripts, etc) to the admin-site. If using this,
# disable creation of the admin/super user in the docker-entrypoint.sh file, otherwise an error at startup can occur.
# - ./dev-environment/system_fixtures:/code/admin_site/system/fixtures/
# - ./dev-environment/changelog_fixtures:/code/admin_site/changelog/fixtures/
depends_on:
- db
ports:
- 9999:9999
- 8080:8080
stdin_open: true
tty: true
container_name: bpc_admin_site_django
privileged: true
cron-service:
build:
context: .
dockerfile: docker/Dockerfile
target: os2borgerpc
volumes:
- .:/code/
- ./dev-environment/dev-settings.ini:/user-settings.ini
- ./dev-environment/system_fixtures:/code/admin_site/system/fixtures/
command: ["supercronic", "/crontab"]
entrypoint: []
depends_on:
- os2borgerpc-admin
db:
image: postgres:latest
restart: always
environment:
# NOTE: These values are only used in the local development
# environment, so it's not particularly important that
# they're secure
POSTGRES_USER: bpc
POSTGRES_PASSWORD: bpc
volumes:
- postgres-data:/var/lib/postgresql/data
container_name: bpc_admin_site_db
volumes:
postgres-data:
scripts: