-
-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
110 lines (103 loc) · 2.5 KB
/
Copy pathdocker-compose.yml
File metadata and controls
110 lines (103 loc) · 2.5 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
104
105
106
107
108
109
110
version: "3.8"
services:
# Telegram Bot
bot:
build:
context: .
dockerfile: Dockerfile
container_name: dating_bot
env_file:
- .env
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
restart: unless-stopped
volumes:
- ./logs:/app/logs
- ./images:/app/images
networks:
- dating_network
command: python main.py
# PostgreSQL Database
postgres:
image: postgres:16-alpine
container_name: dating_postgres
environment:
POSTGRES_DB: ${DB_NAME:-dating_bot}
POSTGRES_USER: ${DB_USER:-postgres}
POSTGRES_PASSWORD: ${DB_PASS:-postgres}
POSTGRES_INITDB_ARGS: "-E UTF8 --locale=en_US.UTF-8"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- "${DB_PORT:-5432}:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-postgres}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- dating_network
restart: unless-stopped
# Redis for FSM and Cache
redis:
image: redis:7-alpine
container_name: dating_redis
command: redis-server --requirepass ${REDIS_PASS:-redis_password} --appendonly yes
volumes:
- redis_data:/data
ports:
- "${REDIS_PORT:-6379}:6379"
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- dating_network
restart: unless-stopped
# PgAdmin for Database Management (Development only)
pgadmin:
image: dpage/pgadmin4:latest
container_name: dating_pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_EMAIL:-admin@admin.com}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_PASSWORD:-admin}
PGADMIN_CONFIG_SERVER_MODE: "False"
ports:
- "${PGADMIN_PORT:-5050}:80"
depends_on:
- postgres
networks:
- dating_network
restart: unless-stopped
profiles:
- dev
# Nginx Reverse Proxy (Production)
nginx:
image: nginx:alpine
container_name: dating_nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/ssl:/etc/nginx/ssl:ro
depends_on:
- api
networks:
- dating_network
restart: unless-stopped
profiles:
- prod
networks:
dating_network:
driver: bridge
volumes:
postgres_data:
driver: local
redis_data:
driver: local