This repository has been archived by the owner on Jul 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.prod.yml
162 lines (159 loc) · 4.19 KB
/
docker-compose.prod.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
version: '3.8'
x-logging: &loki-logging
driver: loki
options:
loki-url: "http://localhost:3100/api/prom/push"
services:
backend-django:
build: ./src/backend/teaser
restart: unless-stopped
# command: bash -c " python manage.py runserver 0.0.0.0:8000"
command: gunicorn --env DJANGO_SETTINGS_MODULE=teaser.settings teaser.wsgi:application --bind 0.0.0.0:8000
ports:
- 8069:8000
volumes:
- static_volume:/app/static
- ./src/backend/teaser:/app
environment:
- REDIS_CACHE=redis_cache
env_file:
- .backend.env
depends_on:
- db
- redis_cache
logging: *loki-logging
networks:
- teaser-network
# frontend:
# build: ./src/frontend/teaser
# command: npm run start
# ports:
# - 8081:8081
# - 42069:42069
# env_file:
# - .frontend.env
# volumes:
# - ./src/frontend/teaser:/app
# - /app/node_modules
# networks:
# - teaser-network
db:
image: postgres:15.2
restart: unless-stopped
volumes:
- ./data:/var/lib/postgresql/data/
expose:
- 5432
environment:
- POSTGRES_USER=teaseruser
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=teaser
networks:
- teaser-network
nginx:
restart: unless-stopped
image: nginx:1.21-alpine
ports:
- 80:80
- 443:443
volumes:
- static_volume:/app/static
- ./nginx:/etc/nginx/conf.d
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
depends_on:
- backend-django
networks:
- teaser-network
certbot:
image: certbot/certbot
restart: unless-stopped
# entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew ${PROSODY_INTEGRATION}; sleep 12h & wait $${!}; done;'"
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew ${PROSODY_INTEGRATION}; sleep 12h & wait $${!}; done;'"
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
# environment:
# - PROSODY_INTEGRATION=--deploy-hook "prosodyctl --root cert import /etc/letsencrypt/live"
# prosody:
# image: prosody/prosody
# build: ./prosody
# ports:
# - 5222:5222
# - 5269:5269
# - 5280:5280
# depends_on:
# - nginx
# volumes:
# - ./prosody/config:/etc/prosody
# - ./prosody/log:/var/log/prosody
# - ./certbot/conf:/etc/letsencrypt
# # - ./prosody/modules:/usr/lib/prosody/prosody-modules-enabled
# environment:
# - PROSODY_PASSWORD=${PROSODY_PASSWORD}
# - PROSODY_DOMAIN=${PROSODY_DOMAIN}
# - PROSODY_VIRTUAL_HOSTS=${PROSODY_VIRTUAL_HOSTS}
# - PROSODY_INTEGRATION=${PROSODY_INTEGRATION}
prometheus:
build: ./src/prometheus
restart: unless-stopped
volumes:
- ./src/prometheus:/prometheus
ports:
- 9090:9090
networks:
- teaser-network
grafana:
build: ./src/grafana
restart: unless-stopped
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD}
volumes:
- ./src/grafana:/grafana
ports:
- 3000:3000
depends_on:
- prometheus
logging: *loki-logging
user: '472'
networks:
- teaser-network
loki:
image: grafana/loki:2.6.1
restart: unless-stopped
ports:
- 3100:3100
command: -config.file=/etc/loki/local-config.yaml
networks:
- teaser-network
redis_cache: # TODO: Run redis/redis-stack-server in prod
image: redis/redis-stack
restart: always
# volumes:
# - ./redis.conf:/usr/local/etc/redis/redis.conf # use default config
# - "redis:/data"
ports:
- 6379:6379
- 8001:8001
# command: redis-server
networks:
- teaser-network
redis-exporter:
image: oliver006/redis_exporter
ports:
- 9121:9121
environment:
REDIS_ADDR: redis_cache:6379
# REDIS_USER: ${PROD_REDIS_USERNAME}
# REDIS_PASSWORD: ${PROD_REDIS_PASSWORD}
links:
- redis_cache
- prometheus
networks:
- teaser-network
volumes:
static_volume:
redis: {}
networks:
teaser-network: