-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
78 lines (71 loc) · 1.68 KB
/
docker-compose.yaml
File metadata and controls
78 lines (71 loc) · 1.68 KB
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
version: '3.4'
services:
#########################
# DATABASE
#########################
postgres:
image: postgres
restart: always
container_name: postgres
logging:
driver: "json-file"
options:
max-file: "5"
max-size: "10m"
ports:
- 5433:${DB_PORT}
volumes:
- ./volumes/postgresql:/var/lib/postgresql/data
env_file: .env
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "auction_db", "-U", "auction" ]
timeout: 45s
interval: 10s
retries: 10
networks:
- backend_network
#########################
# Django app
#########################
backend:
build:
context: ./backend/
target: prod
restart: always
container_name: backend
command: bash -c "python /app/manage.py collectstatic --noinput && gunicorn auction_backend.wsgi:application --bind 0.0.0.0:$APP_PORT --access-logfile -"
logging:
driver: "json-file"
options:
max-file: "5"
max-size: "10m"
volumes:
- ./volumes/staticfiles:/app/static
- ./volumes/media:/app/media
ports:
- ${APP_PORT}:${APP_PORT}
env_file: .env
networks:
- backend_network
depends_on:
- postgres
#########################
# Nginx
#########################
nginx:
build:
context: ./nginx/
target: base
restart: always
container_name: nginx
ports:
- ${SERVER_PORT}:${SERVER_PORT}
volumes:
- ./volumes/nginx/default.conf:/etc/nginx/conf.d/default.conf
- ./volumes/staticfiles:/static
- ./volumes/media:/media
networks:
- backend_network
networks:
backend_network:
driver: bridge