-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
67 lines (63 loc) · 1.42 KB
/
Copy pathdocker-compose.yml
File metadata and controls
67 lines (63 loc) · 1.42 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
services:
backend:
build: .
container_name: backend
restart: unless-stopped
env_file:
- .env
environment:
DB_HOST: postgres
REDIS_HOST: redis
ports:
- ${BACKEND_PORT}:8000
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- freebots_shared_network
postgres:
image: postgres:17
restart: unless-stopped
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASS}
POSTGRES_DB: ${DB_NAME}
ports:
- ${DB_PORT}:5432
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- freebots_shared_network
redis:
image: redis:7-alpine
restart: unless-stopped
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD}
REDIS_USER: ${REDIS_USER}
REDIS_USER_PASSWORD: ${REDIS_USER_PASSWORD}
ports:
- ${REDIS_PORT}:6379
volumes:
- redis_data:/data
healthcheck:
test: [ "CMD", "redis-cli", "-a", "$REDIS_PASSWORD", "ping" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- freebots_shared_network
volumes:
postgres_data:
redis_data:
networks:
freebots_shared_network:
external: true