-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
51 lines (49 loc) · 1.17 KB
/
docker-compose.yml
File metadata and controls
51 lines (49 loc) · 1.17 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
services:
app:
image: ${APP_IMAGE:-docker.io/myagmb28/pawgun:latest}
container_name: pogun-backend
restart: unless-stopped
env_file:
- .env
environment:
PORT: ${PORT:-8080}
REDIS_HOST: redis
REDIS_PORT: 6379
depends_on:
redis:
condition: service_healthy
ports:
- "${PORT:-8080}:8080"
healthcheck:
test: ["CMD", "/usr/local/bin/healthcheck-adaptive.sh"]
interval: 2s
timeout: 5s
retries: 12
start_period: 40s
redis:
image: redis:7-alpine
container_name: pogun-redis
restart: unless-stopped
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
command: >
sh -c '
if [ -n "$$REDIS_PASSWORD" ]; then
exec redis-server --appendonly yes --requirepass "$$REDIS_PASSWORD";
else
exec redis-server --appendonly yes;
fi
'
volumes:
- redis-data:/data
healthcheck:
test:
[
"CMD-SHELL",
"if [ -n \"$$REDIS_PASSWORD\" ]; then redis-cli -a \"$$REDIS_PASSWORD\" ping; else redis-cli ping; fi",
]
interval: 10s
timeout: 3s
retries: 5
volumes:
redis-data: