/
docker-compose.yml
109 lines (104 loc) · 2.36 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
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
version: "3.1"
name: tvof
services:
nginx-proxy:
image: nginxproxy/nginx-proxy:1.3
ports:
- "80:80"
restart: unless-stopped
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
depends_on:
nginx:
condition: service_started
nginx:
build:
context: ..
dockerfile: ./compose/nginx/Dockerfile
environment:
VIRTUAL_PATH: "~^/(media|static)/"
VIRTUAL_PORT: 8001
env_file:
- ../.envs/.shared
volumes:
- ../staticfiles:/usr/share/nginx/static:ro
- ../tvof/media:/usr/share/nginx/media:ro
expose:
- 8001
depends_on:
django:
condition: service_healthy
restart: unless-stopped
django:
build:
context: ..
dockerfile: ./compose/django/Dockerfile
environment:
VIRTUAL_PATH: "/"
VIRTUAL_PORT: 8000
command:
[
"/usr/local/bin/gunicorn",
"config.wsgi",
"--bind",
"0.0.0.0:8000",
"--chdir=/app",
"--timeout",
"180",
"--forwarded-allow-ips='*'",
]
env_file:
- ../.envs/.shared
- ../.envs/.django
- ../.envs/.postgres
volumes:
- ../:/app
expose:
- 8000
restart: unless-stopped
healthcheck:
test: "cat /proc/net/tcp | grep 1F40 > /dev/null"
interval: 3s
timeout: 3s
retries: 100
depends_on:
db:
condition: service_healthy
elasticsearch:
condition: service_healthy
db:
build:
context: ..
dockerfile: ./compose/postgres/Dockerfile
volumes:
- ../volumes/local_postgres_data:/var/lib/postgresql/data:Z
- ../volumes/local_postgres_data_backups:/backups:z
env_file:
- ../.envs/.postgres
expose:
- 5432
healthcheck:
test: ["CMD", "pg_isready", "-d", "django", "-U", "django_app"]
interval: 3s
timeout: 3s
retries: 10
restart: unless-stopped
elasticsearch:
# image: elasticsearch:7.10.1
# GN: reduced to 5 to match python ES package
image: elasticsearch:7.10.1
environment:
- discovery.type=single-node
expose:
- 9200
- 9300
healthcheck:
test: curl -s -f http://localhost:9200 > /dev/null || exit 1
interval: 5s
timeout: 3s
retries: 10
restart: unless-stopped
#
# redis:
# image: redis:5.0
# restart: unless-stopped