-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
72 lines (65 loc) · 1.8 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
version: '3.2'
services:
web:
build: ./docker/web
environment:
- DJANGO_SETTINGS_MODULE=DomainExplorer.settings.production
env_file:
- .env
volumes:
- static_volume:/code/run/static
- media_volume:/code/run/media
- ./container:/code
networks:
- digger_database_network
- digger_nginx_network
depends_on:
- db
db:
image: postgres:12.0
env_file:
- .env
networks:
- digger_database_network
# This is to make the database accessible from the host machine. The database runs on port 5432, but as to not have multiple databases accessible under 5432, we map it to the unique port 5461.
# PortOnHost:PortInsideContainer
# Access with command: psql -h localhost -U postgres -p 5461
ports:
- 5461:5432 # Change this part
volumes:
- postgres_data:/var/lib/postgresql/data/
nginx:
build: ./docker/nginx
volumes:
- static_volume:/data/digger/run/static
- media_volume:/data/digger/run/media
# If you want the application to be listening on another port different than port 8000
# Change the 'published' port number to the port you desire
ports:
- target: 80
published: 8061 #${NGINX_PUBLISHED_PORT} # Change this port
protocol: tcp
mode: host
environment:
- NGINX_PUBLISHED_PATH=${NGINX_PUBLISHED_PATH}
networks:
- digger_nginx_network
depends_on:
- web
networks:
digger_database_network:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.16.111.0/24
digger_nginx_network:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.16.110.0/24
volumes:
postgres_data:
static_volume:
media_volume: