-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
52 lines (49 loc) · 1.41 KB
/
Copy pathdocker-compose.yml
File metadata and controls
52 lines (49 loc) · 1.41 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
services:
db:
image: postgres:15-alpine
container_name: racb_db
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-racb}
POSTGRES_USER: ${POSTGRES_USER:-racb_user}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-racb_secure_password}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-racb_user} -d ${POSTGRES_DB:-racb}"]
interval: 5s
timeout: 5s
retries: 5
ports:
# Expose PostgreSQL to host localhost (127.0.0.1) for secure SSH tunneling and GUI management (pgAdmin 4, DBeaver)
# Never binds to 0.0.0.0 to prevent public internet exposure
- "127.0.0.1:5432:5432"
networks:
- racb_net
bot:
build:
context: .
dockerfile: Dockerfile
container_name: racb
restart: unless-stopped
depends_on:
db:
condition: service_healthy
env_file:
- .env
environment:
# Defaults to the internal docker postgres service if not explicitly overridden in .env
DATABASE_URL: ${DATABASE_URL:-postgresql://${POSTGRES_USER:-racb_user}:${POSTGRES_PASSWORD:-racb_secure_password}@db:5432/${POSTGRES_DB:-racb}}
DB_SSLMODE: disable
volumes:
- logs:/app/logs
networks:
- racb_net
networks:
racb_net:
driver: bridge
volumes:
postgres_data:
name: racb_postgres_data
logs:
name: racb_logs