-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
91 lines (87 loc) · 2.06 KB
/
Copy pathdocker-compose.yml
File metadata and controls
91 lines (87 loc) · 2.06 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
version: '3.9'
services:
# PostgreSQL Database
postgres-db:
image: postgres:16-alpine
container_name: sentinel-postgres
restart: unless-stopped
ports:
- '${POSTGRES_PORT:-5432}:5432'
environment:
POSTGRES_DB: ${POSTGRES_DB:-sentinel}
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- sentinel-postgres-data:/var/lib/postgresql/data
- ./migrations:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-sentinel}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
networks:
- sentinel-network
deploy:
resources:
limits:
cpus: '1.0'
memory: 512M
reservations:
cpus: '0.5'
memory: 256M
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Redis Cache
redis-cache:
image: redis:7-alpine
container_name: sentinel-redis
restart: unless-stopped
ports:
- '${REDIS_PORT:-6379}:6379'
command: >
redis-server
--requirepass ${REDIS_PASSWORD:-sentinel}
--maxmemory 256mb
--maxmemory-policy allkeys-lru
--save 60 1000
--appendonly yes
volumes:
- sentinel-redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 10s
timeout: 3s
retries: 5
start_period: 10s
networks:
- sentinel-network
deploy:
resources:
limits:
cpus: '0.5'
memory: 256M
reservations:
cpus: '0.25'
memory: 128M
logging:
driver: "json-file"
options:
max-size: "5m"
max-file: "3"
networks:
sentinel-network:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.25.0.0/16
volumes:
sentinel-postgres-data:
driver: local
sentinel-redis-data:
driver: local