-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
46 lines (42 loc) · 1.24 KB
/
docker-compose.yml
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
version: '3.9'
services:
postgres:
image: 'postgres:16-alpine'
restart: unless-stopped
ports:
- '5432:5432'
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB']
interval: 5s # Check every 5 seconds for readiness
timeout: 5s # Allow up to 5 seconds for a response
retries: 3 # Fail after 3 unsuccessful attempts
start_period: 10s # Start checks after 10 seconds
networks:
- app-network
redis:
image: 'redis:7.2-alpine'
restart: unless-stopped
command: --loglevel warning --maxmemory-policy noeviction
volumes:
- redis-data:/data
ports:
- '6379:6379'
healthcheck:
test: ['CMD-SHELL', 'redis-cli ping']
interval: 5s # Check every 5 seconds
timeout: 5s # Allow up to 5 seconds for a response
retries: 3 # Fail after 3 unsuccessful attempts
start_period: 5s # Start health checks after 5 seconds
networks:
- app-network
volumes:
postgres-data:
redis-data:
networks:
app-network: