-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
91 lines (86 loc) · 2.12 KB
/
docker-compose.yml
File metadata and controls
91 lines (86 loc) · 2.12 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
services:
db:
image: postgres:18
container_name: postgres-server
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
ports:
- 127.0.0.1:${POSTGRES_PORT}:5432
volumes:
- ./postgres-server/pgdata:/var/lib/postgresql
networks:
- shared-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
db_init:
image: postgres:18
depends_on:
db:
condition: service_healthy
networks:
- shared-network
volumes:
- ./postgres-server/pginit:/pginit:ro
environment:
POSTGRES_USER: ${POSTGRES_USER}
PGPASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
restart: "no"
command: >
bash -lc "
psql -v ON_ERROR_STOP=1 -h db -U ${POSTGRES_USER} -d ${POSTGRES_DB} -f /pginit/initdb.sql
"
bot:
build:
context: ./telegramBot
dockerfile: Dockerfile
container_name: telegram-bot
restart: unless-stopped
environment:
TOKEN: ${TOKEN}
DATABASE_URL: ${DATABASE_URL}
networks:
- shared-network
frontend:
image: nginx:alpine
container_name: website-frontend
restart: unless-stopped
volumes:
- ./website/frontend/index.html:/usr/share/nginx/html/index.html:ro
networks:
- shared-network
backend:
image: python:3.12-slim
container_name: website-backend
restart: unless-stopped
working_dir: /app
command: >
sh -c "pip install --no-cache-dir flask && python app.py"
volumes:
- ./website/backend/app.py:/app/app.py:ro
expose:
- 5000
networks:
- shared-network
nginx:
image: nginx:alpine
container_name: website-http-server
restart: unless-stopped
depends_on:
- frontend
- backend
ports:
- "80:80"
volumes:
- ./website/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
networks:
- shared-network
networks:
shared-network:
external: true