forked from HackAssistant/registration
-
Notifications
You must be signed in to change notification settings - Fork 10
/
docker-compose.yaml
40 lines (39 loc) · 1.2 KB
/
docker-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
version: '3'
services:
web:
build: .
ports:
- "${MYHACKUPC_PORT}:8000" # Map Gunicorn port
volumes:
- ./files:/code/files # cv stuff
- ./.google-service.account.json:/code/.google-service.account.json # needed for google wallet application purpouses
expose:
- "${MYHACKUPC_PORT}"
env_file:
- .env
depends_on:
db:
condition: service_healthy
command: >
sh -c "python manage.py migrate &&
crond && syslogd &&
gunicorn --bind :8000 --workers 3 app.wsgi"
# Apply migrations and then start the application
# Initialize crond and syslogd to be able to schedule jobs
db:
image: postgres:alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- .env
ports:
- "${POSTGRES_PORT}:5432"
expose:
- "${POSTGRES_PORT}"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
retries: 5
timeout: 5s
volumes:
postgres_data: