-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
57 lines (53 loc) · 1.45 KB
/
docker-compose.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
version: '3.8'
services:
db:
image: postgres:13
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=${DB_NAME:-simple_imap2api}
- POSTGRES_USER=${DB_USER:-dbuser}
- POSTGRES_PASSWORD=${DB_PASSWORD:-dbpassword}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-dbuser} -d ${DB_NAME:-simple_imap2api}"]
interval: 10s
timeout: 5s
retries: 5
web:
build: .
command: >
sh -c "python manage.py migrate &&
python manage.py collectstatic --noinput &&
gunicorn simple_imap2api.wsgi:application --bind 0.0.0.0:8000"
volumes:
- .:/app
- static_volume:/app/staticfiles
- media_volume:/app/media
expose:
- 8000
environment:
- DJANGO_SECRET_KEY=${DJANGO_SECRET_KEY:-your-secret-key-here}
- DJANGO_DEBUG=${DJANGO_DEBUG:-False}
- ALLOWED_HOSTS=${ALLOWED_HOSTS:-localhost,127.0.0.1}
- DB_NAME=${DB_NAME:-simple_imap2api}
- DB_USER=${DB_USER:-dbuser}
- DB_PASSWORD=${DB_PASSWORD:-dbpassword}
- DB_HOST=db
- DB_PORT=5432
depends_on:
db:
condition: service_healthy
nginx:
image: nginx:1.21
volumes:
- static_volume:/app/staticfiles
- media_volume:/app/media
- ./nginx.conf:/etc/nginx/conf.d/default.conf
ports:
- "${PORT:-80}:80"
depends_on:
- web
volumes:
postgres_data:
static_volume:
media_volume: