-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
56 lines (52 loc) · 1.41 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
version: '3.8'
services:
db:
image: postgres:16-alpine
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=${POSTGRES_DB:-offersplus}
- POSTGRES_USER=${POSTGRES_USER:-offersplus}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-offersplus}
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-offersplus}"]
interval: 5s
timeout: 5s
retries: 5
web:
build: .
volumes:
- .:/app
- static_volume:/app/staticfiles
- media_volume:/app/mediafiles
ports:
- "8000:8000"
environment:
- POSTGRES_DB=${POSTGRES_DB:-offersplus}
- POSTGRES_USER=${POSTGRES_USER:-offersplus}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-offersplus}
- POSTGRES_HOST=db
- POSTGRES_PORT=5432
- DJANGO_SETTINGS_MODULE=offer_plus.settings
- DJANGO_SECRET_KEY=${DJANGO_SECRET_KEY:-your-secret-key}
- DJANGO_DEBUG=${DJANGO_DEBUG:-False}
- DJANGO_ALLOWED_HOSTS=${DJANGO_ALLOWED_HOSTS:-localhost,127.0.0.1}
depends_on:
db:
condition: service_healthy
nginx:
image: nginx:alpine
volumes:
- static_volume:/app/staticfiles
- media_volume:/app/mediafiles
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
ports:
- "80:80"
depends_on:
- web
volumes:
postgres_data:
static_volume:
media_volume: