Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
96 lines (92 loc) · 2.18 KB
/
Copy pathdocker-compose.yml
File metadata and controls
96 lines (92 loc) · 2.18 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
version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile
container_name: ticket_system_app
ulimits:
nofile:
soft: 65536
hard: 65536
nproc:
soft: 32768
hard: 32768
ports:
- "${PORT:-8000}:8000"
env_file:
- .env
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
networks:
- ticket_network
restart: unless-stopped
db:
image: postgres:16-alpine
container_name: ticket_system_db
command: |
postgres
-c max_connections=500
-c shared_buffers=1GB
-c effective_cache_size=3GB
-c maintenance_work_mem=256MB
-c checkpoint_completion_target=0.9
-c wal_buffers=16MB
-c default_statistics_target=100
-c random_page_cost=1.1
-c effective_io_concurrency=200
-c work_mem=8MB
-c min_wal_size=1GB
-c max_wal_size=4GB
-c checkpoint_timeout=15min
-c max_wal_senders=10
-c wal_level=replica
-c hot_standby=on
-c wal_log_hints=on
-c log_checkpoints=off
-c log_connections=off
-c log_disconnections=off
-c log_lock_waits=on
-c log_min_duration_statement=1000
environment:
- POSTGRES_USER=${POSTGRES_USER:-ticket_user}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-ticket_password}
- POSTGRES_DB=${POSTGRES_DB:-ticket_system}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-ticket_user} -d ${POSTGRES_DB:-ticket_system}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- ticket_network
restart: unless-stopped
cache:
image: redis:7-alpine
container_name: ticket_system_cache
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- ticket_network
restart: unless-stopped
volumes:
postgres_data:
redis_data:
cargo-cache:
target-cache:
networks:
ticket_network:
driver: bridge