-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
63 lines (59 loc) · 1.52 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
version: '3.8'
services:
db:
image: postgres:17-alpine
env_file: docker/.env
environment:
POSTGRES_DB: qubit
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7.4.1-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
- redis_logs:/var/log/redis
- ./data/redis.conf:/usr/local/etc/redis/redis.conf:ro
command: >
sh -c "mkdir -p /var/log/redis &&
chown redis:redis /var/log/redis &&
redis-server /usr/local/etc/redis/redis.conf"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
app:
build:
context: .
dockerfile: Dockerfile
env_file: .env
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
environment:
DATABASE_URL: postgresql://postgres:${DB_PASSWORD}@db:5432/qubit
AUTH_SECRET_KEY: ${AUTH_SECRET_KEY}
REDIS_URL: redis://redis:6379/0
ADMIN_USERNAME: ${ADMIN_USERNAME}
ADMIN_EMAIL: ${ADMIN_EMAIL}
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
volumes:
- ./data/config.yaml:/app/data/config.yaml:ro
- ./docker/entrypoint.sh:/app/entrypoint.sh:ro
command: ["bash", "/app/entrypoint.sh"]
volumes:
postgres_data:
redis_data:
redis_logs: