-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
53 lines (50 loc) · 1.07 KB
/
docker-compose.yaml
File metadata and controls
53 lines (50 loc) · 1.07 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
version: '3.8'
services:
redis:
image: redis:7-alpine
container_name: judgment-bot-redis
command: >
sh -c "
if [ -n \"$$REDIS_PASSWORD\" ]; then
redis-server --requirepass \"$$REDIS_PASSWORD\"
else
redis-server
fi
"
volumes:
- judgment_bot_redis_data:/data
environment:
- REDIS_PASSWORD=${REDIS_PASSWORD:-}
restart: unless-stopped
healthcheck:
test: |
if [ -n "$REDIS_PASSWORD" ]; then
redis-cli -a "$REDIS_PASSWORD" ping
else
redis-cli ping
fi
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
app:
build:
context: .
dockerfile: Dockerfile
container_name: judgment-bot
depends_on:
redis:
condition: service_healthy
env_file:
- .env
environment:
- REDIS_HOST=redis
- REDIS_PORT=6379
volumes:
- ./logs:/app/logs
restart: unless-stopped
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
judgment_bot_redis_data:
driver: local