-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
162 lines (151 loc) · 3.96 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
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
services:
db:
user: root
build:
context: ./databases/PostgreSQL
dockerfile: Dockerfile
container_name: postgres_db
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${ADMIN_PASSWORD}
POSTGRES_DB: ${DBNAME}
BACKEND_PASSWORD: ${BACKEND_PASSWORD}
READER_PASSWORD: ${READER_PASSWORD}
TEST_DB_NAME: ${TEST_DB_NAME}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./databases/PostgreSQL/init.sql:/init.sql
- ./databases/PostgreSQL/roles.sql:/roles.sql
- ./databases/PostgreSQL/roots.sql:/roots.sql
networks:
- default
redis:
container_name: redis_for_bot
build:
context: ./databases/Redis
dockerfile: Dockerfile
ports:
- "6379:6379"
volumes:
- redis_for_bot_data:/data
- ./databases/Redis/redis.conf:/redis.conf
environment:
REDIS_FOR_BOT_PASSWORD: ${REDIS_FOR_BOT_PASSWORD}
command: ["sh", "-c", "envsubst < /redis.conf > /tmp/processed_redis.conf && redis-server /tmp/processed_redis.conf"]
networks:
- default
mongodb:
container_name: mongodb
image: mongo:6-jammy
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
networks:
- default
web:
container_name: web
build:
context: ./backend
dockerfile: Dockerfile
command: bash -c "uvicorn main:main --host 0.0.0.0 --port 8000"
volumes:
- .:/app
environment:
TOKEN_FOR_GEOSUGGEST: ${TOKEN_FOR_GEOSUGGEST}
TOKEN_FOR_GEOCODER: ${TOKEN_FOR_GEOCODER}
MONGO_DATABASE: ${MONGO_DATABASE}
MENU_COLLECTION: ${MENU_COLLECTION}
TEST_MENU_COLLECTION: ${TEST_MENU_COLLECTION}
S3_ACCESS_KEY: ${S3_ACCESS_KEY}
S3_SECRET_KEY: ${S3_SECRET_KEY}
S3_BACKET_NAME: ${S3_BACKET_NAME}
DBNAME: ${DBNAME}
TEST_DB_NAME: ${TEST_DB_NAME}
BACKEND_PASSWORD: ${BACKEND_PASSWORD}
DEBUG: ${DEBUG}
LOGGING_LEVEL: ${LOGGING_LEVEL}
BOT_TOKEN: ${BOT_TOKEN}
ports:
- "8000:8000"
depends_on:
- mongodb
- redis
- db
networks:
- default
telegram_bot:
container_name: telegram_bot
build:
context: ./bot
dockerfile: Dockerfile
environment:
REDIS_FOR_BOT_PASSWORD: ${REDIS_FOR_BOT_PASSWORD}
BOT_TOKEN: ${BOT_TOKEN}
volumes:
- ./bot/bot_api:/bot/bot_api
ports:
- "8081:8081"
command: ["python3", "bot_api/bot.py"]
depends_on:
- web # Зависит от бд-шек так как зависит от web
networks:
- default
frontend:
container_name: frontend
build:
context: ./frontend
dockerfile: Dockerfile
volumes:
- ./frontend/public:/app/public
- ./frontend/src:/app/src
ports:
- "3000:3000"
depends_on:
- telegram_bot
command: ["sh", "-c", "npm run build && serve -s build"]
networks:
- default
nginx:
container_name: nginx
build:
context: ./nginx
dockerfile: Dockerfile
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/certs:/certs
- nginx_log:/etc/nginx/var/log # Пишем логи в том
depends_on:
- frontend
command: sh -c "nginx -c /etc/nginx/nginx.conf -g 'daemon off;'"
networks:
- default
ddns:
container_name: ddns
build:
context: ./ddns
dockerfile: Dockerfile
environment:
DUCK_TOKEN: ${DUCK_TOKEN}
TEST: ${TEST}
depends_on:
- nginx
command: ["/bin/bash", "/duckdns/duck.sh"]
networks:
- default
networks:
default:
driver: bridge
driver_opts:
com.docker.network.driver.mtu: 1450
volumes:
postgres_data:
redis_for_bot_data:
mongodb_data:
nginx_log:
https_certs: