-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
164 lines (156 loc) · 5.41 KB
/
Copy pathdocker-compose.yml
File metadata and controls
164 lines (156 loc) · 5.41 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
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
x-logging: &default-logging
driver: json-file
options:
max-size: "10m"
max-file: "5"
services:
media-init:
image: alpine:3.20
container_name: wcsd-helpdesk-media-init
restart: "no"
command: ["sh", "-c", "chown -R 100:101 /app/media"]
volumes:
- media_data:/app/media
logging: *default-logging
db:
image: postgres:16-alpine
container_name: wcsd-helpdesk-db
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-helpdesk}
POSTGRES_USER: ${POSTGRES_USER:-helpdesk}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-prototype-only-change-me}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-helpdesk} -d ${POSTGRES_DB:-helpdesk}"]
interval: 5s
timeout: 3s
retries: 12
volumes:
- postgres_data:/var/lib/postgresql/data
logging: *default-logging
web:
image: wcsd-helpdesk-prototype-web:latest
build:
context: ./backend
container_name: wcsd-helpdesk-web
restart: unless-stopped
environment:
DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY:-prototype-secret-not-for-production}
DJANGO_DEBUG: ${DJANGO_DEBUG:-false}
DJANGO_ALLOWED_HOSTS: ${DJANGO_ALLOWED_HOSTS:-localhost,127.0.0.1,web}
POSTGRES_HOST: db
POSTGRES_PORT: 5432
POSTGRES_DB: ${POSTGRES_DB:-helpdesk}
POSTGRES_USER: ${POSTGRES_USER:-helpdesk}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-prototype-only-change-me}
AUTH_MODE: ${AUTH_MODE:-local_accounts}
GOOGLE_OIDC_CLIENT_ID: ${GOOGLE_OIDC_CLIENT_ID:-}
GOOGLE_OIDC_CLIENT_SECRET: ${GOOGLE_OIDC_CLIENT_SECRET:-}
GOOGLE_OIDC_ALLOWED_DOMAIN: ${GOOGLE_OIDC_ALLOWED_DOMAIN:-wcsd.org}
GOOGLE_OIDC_REDIRECT_URI: ${GOOGLE_OIDC_REDIRECT_URI:-http://localhost:8788/auth/google/callback/}
MAIL_MODE: ${MAIL_MODE:-disabled}
HELPDESK_FROM_EMAIL: ${HELPDESK_FROM_EMAIL:-helpdesk@wcsd.org}
HELPDESK_REPLY_TO_EMAIL: ${HELPDESK_REPLY_TO_EMAIL:-helpdesk@wcsd.org}
HELPDESK_EMAIL_BATCH_SIZE: ${HELPDESK_EMAIL_BATCH_SIZE:-75}
PUBLIC_STAFF_PORTAL_URL: ${PUBLIC_STAFF_PORTAL_URL:-http://localhost:8788}
PUBLIC_TECHNICIAN_PORTAL_URL: ${PUBLIC_TECHNICIAN_PORTAL_URL:-http://localhost:8789}
EMAIL_HOST: ${EMAIL_HOST:-smtp.gmail.com}
EMAIL_PORT: ${EMAIL_PORT:-587}
EMAIL_USE_TLS: ${EMAIL_USE_TLS:-true}
EMAIL_USE_SSL: ${EMAIL_USE_SSL:-false}
GMAIL_SMTP_USER: ${GMAIL_SMTP_USER:-}
GMAIL_APP_PASSWORD: ${GMAIL_APP_PASSWORD:-}
MAIL_CREDENTIAL_KEY: ${MAIL_CREDENTIAL_KEY:-}
EMAIL_TIMEOUT: ${EMAIL_TIMEOUT:-20}
SESSION_COOKIE_AGE: ${SESSION_COOKIE_AGE:-2592000}
COOKIE_SECURE: ${COOKIE_SECURE:-false}
SELF_SERVICE_EMAIL_DOMAIN: ${SELF_SERVICE_EMAIL_DOMAIN:-wcsd.org}
command: >-
sh -c "python manage.py migrate --noinput &&
python manage.py collectstatic --noinput &&
gunicorn helpdesk.wsgi:application --bind 0.0.0.0:8000 --workers 2 --threads 2 --timeout 60"
healthcheck:
test:
[
"CMD-SHELL",
"python -c \"import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/healthz', timeout=3)\"",
]
interval: 10s
timeout: 5s
retries: 12
start_period: 30s
depends_on:
db:
condition: service_healthy
media-init:
condition: service_completed_successfully
volumes:
- media_data:/app/media
logging: *default-logging
mail-worker:
image: wcsd-helpdesk-prototype-web:latest
container_name: wcsd-helpdesk-mail-worker
restart: unless-stopped
environment:
DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY:-prototype-secret-not-for-production}
POSTGRES_HOST: db
POSTGRES_PORT: 5432
POSTGRES_DB: ${POSTGRES_DB:-helpdesk}
POSTGRES_USER: ${POSTGRES_USER:-helpdesk}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-prototype-only-change-me}
MAIL_CREDENTIAL_KEY: ${MAIL_CREDENTIAL_KEY:-}
EMAIL_TIMEOUT: ${EMAIL_TIMEOUT:-20}
command: python manage.py poll_inbound_mail --interval 30
depends_on:
db:
condition: service_healthy
web:
condition: service_healthy
volumes:
- media_data:/app/media
logging: *default-logging
staff-portal:
image: nginx:1.27-alpine
container_name: wcsd-helpdesk-staff
restart: unless-stopped
ports:
- "8788:80"
volumes:
- ./src:/usr/share/nginx/html:ro
- ./nginx/staff.conf:/etc/nginx/conf.d/default.conf:ro
- ./nginx/portal.staff.js:/etc/nginx/portal-config.js:ro
depends_on:
web:
condition: service_healthy
logging: *default-logging
technician-portal:
image: nginx:1.27-alpine
container_name: wcsd-helpdesk-technician
restart: unless-stopped
ports:
- "8789:80"
volumes:
- ./src:/usr/share/nginx/html:ro
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
- ./nginx/portal.technician.js:/etc/nginx/portal-config.js:ro
depends_on:
web:
condition: service_healthy
logging: *default-logging
guest-portal:
image: nginx:1.27-alpine
container_name: wcsd-helpdesk-guest
restart: unless-stopped
ports:
- "8790:80"
volumes:
- ./src:/usr/share/nginx/html:ro
- ./nginx/guest.conf:/etc/nginx/conf.d/default.conf:ro
- ./nginx/portal.guest.js:/etc/nginx/portal-config.js:ro
depends_on:
web:
condition: service_healthy
logging: *default-logging
volumes:
postgres_data:
media_data: