-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
68 lines (65 loc) · 1.86 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
58
59
60
61
62
63
64
65
66
67
68
# ENV Variables required (no fallback):
# DJANGO_SECRET_KEY
# TARGET_ENV
version: '3.4'
services:
postgres:
image: postgres:${POSTGRES_TAG:-latest}
environment:
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres}
- POSTGRES_DB=${POSTGRES_DB:-postgres}
volumes:
- db-data:/var/lib/postgresql/data
ports:
- ${POSTGRES_PORT:-5432}:${POSTGRES_PORT:-5432}
redis:
image: redis:${REDIS_TAG:-latest}
ur_l:
image: adamwojt/adamwojt:ur_l_${TARGET_ENV:?Target Environment}
build:
dockerfile: ./python_docker/Dockerfile
context: .
target: ${TARGET_ENV:?Target Environment}
environment:
- COV_FAIL_THRESHOLD=90
- DJANGO_SECRET_KEY=${DJANGO_SECRET_KEY:?Django Secret}
- POSTGRES_DB=${POSTGRES_DB:-postgres}
- POSTGRES_HOST=postgres
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres}
- POSTGRES_PORT=${POSTGRES_PORT:-5432}
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- REDIS_HOST=redis
- REDIS_PORT=6379
- CACHE_TIMEOUT_CREATE=${CACHE_TIMEOUT_CREATE:-900}
- CACHE_TIMEOUT_READ=${CACHE_TIMEOUT_READ:-900}
- LOG_TOKEN_COLLISION=${LOG_TOKEN_COLLISION:-1}
- NUM_GUNICORN_WORKERS=${NUM_GUNICORN_WORKERS:-4}
- UR_L_PORT=${UR_L_PORT:-8000}
- URL_USE_CACHE=${URL_USE_CACHE:-1}
command: runserver
depends_on:
- postgres
- redis
volumes:
- static_volume:/app/staticfiles
expose:
- ${UR_L_PORT:-8000}
nginx:
image: adamwojt/adamwojt:ur_l_nginx
environment:
- UR_L_PORT=${UR_L_PORT:-8000}
build:
dockerfile: ./nginx_docker/Dockerfile
context: .
ports:
- ${UR_L_PORT:-8000}:80
depends_on:
- ur_l
volumes:
- static_volume:/ur_l/staticfiles
volumes:
db-data:
driver: local
static_volume:
driver: local