-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
103 lines (88 loc) · 2.3 KB
/
Copy pathdocker-compose.yml
File metadata and controls
103 lines (88 loc) · 2.3 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
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
version: '3.9'
services:
memcached:
image: memcached:latest
container_name: ${PROJECT_NAME}-memcached
restart: unless-stopped
env_file:
- ./.env
redis:
image: redis:7.0.2-alpine
container_name: ${PROJECT_NAME}-redis
restart: unless-stopped
command: redis-server --save ${REDIS_DUMP_INTERVAL} 1000 --loglevel warning --requirepass ${REDIS_PASSWORD} --appendonly no
env_file:
- ./.env
volumes:
- redis:/data
mongo:
image: mongo
restart: unless-stopped
container_name: ${PROJECT_NAME}-mongo
env_file:
- ./.env
postgres:
image: postgres:13.0-alpine
env_file:
- ./.env
restart: unless-stopped
container_name: ${PROJECT_NAME}-postgresql
web:
build:
context: ./backend
dockerfile: Dockerfile
command: sh -c "python manage.py migrate &&
yes | python manage.py collectstatic --no-input &&
gunicorn project_config.wsgi:application --workers=${GUNICORN_WORKERS} --timeout=${GUNICORN_TIMEOUT} --bind 0.0.0.0:${GUNICORN_PORT}"
volumes:
- ./backend:/app
- static_volume:/app/static
- media_volume:/app/media
container_name: ${PROJECT_NAME:-social_media_panel-web}-app
expose:
- ${GUNICORN_PORT}
ports:
- ${GUNICORN_PORT}:${GUNICORN_PORT}
env_file:
- ./.env
depends_on:
- postgres
- mongo
- redis
restart: unless-stopped
environment:
- POSTGRES_HOST=postgres
nginx:
image: nginx:1.23.0-alpine
ports:
- 8000:80
restart: unless-stopped
container_name: ${PROJECT_NAME}-nginx
volumes:
- static_volume:/app/static
- media_volume:/app/media
- ./backend/nginx/conf/:/etc/nginx/conf.d/:rw
- ./nginx/templates/:/etc/nginx/templates/:ro
- ../certbot/www:/var/www/certbot/:ro
- ../certbot/conf/:/etc/nginx/ssl/:ro
env_file:
- ./.env
depends_on:
- web
healthcheck:
test: [ "CMD", "curl", "-f", "${WEB_PROTOCOL}://${SITE_URL}/" ]
interval: 10s
timeout: 5s
retries: 5
extra_hosts:
- "host.docker.internal:host-gateway"
ui:
image: social_media_panel
container_name: ${PROJECT_NAME:-social_media_panel-ui}-ui
ports:
- 3000:80
volumes:
static_volume:
media_volume:
redis:
driver: local