-
Notifications
You must be signed in to change notification settings - Fork 0
/
production.yml
106 lines (94 loc) · 2.29 KB
/
production.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
version: "3.9"
############################# NETWORKS
networks:
selab_network_prod:
name: selab_network_prod
driver: bridge
ipam:
config:
- subnet: 192.168.90.0/24
############################# EXTENSIONS
x-common-keys-selab: &common-keys-selab
networks:
- selab_network_prod
security_opt:
- no-new-privileges:true
restart: unless-stopped
environment:
TZ: $TZ
PUID: $PUID
PGID: $PGID
env_file:
- .env
dns:
- 1.1.1.1
- 4.4.4.4
- 8.8.8.8
############################# SERVICES
services:
nginx:
<<: *common-keys-selab
image: nginx:alpine-slim
container_name: nginx_prod
ports:
- 80:80
- 443:443
volumes:
- ${DATA_DIR}/nginx/nginx.prod.conf:/etc/nginx/nginx.conf:ro
- ${SSL_DIR}:/etc/nginx/ssl:ro
depends_on:
- backend
- frontend
postgres:
<<: *common-keys-selab
image: postgres:15.2
container_name: postgres_prod
environment:
POSTGRES_DB: $POSTGRES_DB
POSTGRES_USER: $POSTGRES_USER
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
volumes:
- ${DATA_DIR}/postgres:/var/lib/postgresql/data
backend:
<<: *common-keys-selab
container_name: backend_prod
build:
context: $BACKEND_DIR
dockerfile: Dockerfile.prod
command: sh -c "./setup.sh && gunicorn --config gunicorn_config.py ypovoli.wsgi:application"
depends_on:
- postgres
redis:
<<: *common-keys-selab
container_name: redis_prod
image: redis:latest
entrypoint: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy allkeys-lru
volumes:
- ${DATA_DIR}/redis:/data
celery:
<<: *common-keys-selab
container_name: celery_prod
build:
context: $BACKEND_DIR
dockerfile: Dockerfile.prod
command: celery -A ypovoli worker -l ERROR
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker/overlay2:/var/lib/docker/overlay2
depends_on:
- backend
- redis
frontend:
<<: *common-keys-selab
container_name: frontend_prod
build:
context: $FRONTEND_DIR
dockerfile: Dockerfile.prod
depends_on:
- backend
docs:
<<: *common-keys-selab
container_name: docs_prod
build:
context: $DOCS_DIR
dockerfile: Dockerfile.prod