-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
95 lines (90 loc) · 2.63 KB
/
docker-compose.yml
File metadata and controls
95 lines (90 loc) · 2.63 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
92
93
94
95
services:
app:
build:
context: .
dockerfile: Dockerfile.backend
args:
INCLUDE_DEV_TOOLS: "${INCLUDE_DEV_TOOLS:-false}"
ports:
- "${SHEAF_PORT:-8000}:${SHEAF_PORT:-8000}"
env_file:
- path: .env
required: false
environment:
SHEAF_PORT: "${SHEAF_PORT:-8000}"
volumes:
- appdata:/app/data
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "python -c \"import urllib.request; urllib.request.urlopen('http://localhost:${SHEAF_PORT:-8000}/health')\""]
interval: 10s
timeout: 5s
retries: 5
db:
image: postgres:16-alpine
ports:
# Bound to loopback by default — the app talks to Postgres over the
# compose network, so the published port is only for local tooling.
# Set POSTGRES_BIND_HOST=0.0.0.0 only if you deliberately want it
# reachable off-host.
- "${POSTGRES_BIND_HOST:-127.0.0.1}:${POSTGRES_PORT:-5432}:5432"
volumes:
- pgdata:/var/lib/postgresql/data
environment:
POSTGRES_DB: sheaf
POSTGRES_USER: sheaf
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme-in-production}
POSTGRES_INITDB_ARGS: "--data-checksums"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U sheaf"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
ports:
# Loopback by default — see the note on the db service above.
- "${REDIS_BIND_HOST:-127.0.0.1}:${REDIS_PORT:-6379}:6379"
volumes:
- redisdata:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
minio:
image: minio/minio:latest
profiles: ["s3"]
ports:
- "${MINIO_API_PORT:-9000}:9000"
- "${MINIO_CONSOLE_PORT:-9001}:9001"
volumes:
- miniodata:/data
environment:
MINIO_ROOT_USER: ${S3_ACCESS_KEY:-minioadmin}
MINIO_ROOT_PASSWORD: ${S3_SECRET_KEY:-minioadmin}
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 5s
timeout: 5s
retries: 5
minio-init:
image: minio/mc:latest
profiles: ["s3"]
depends_on:
minio:
condition: service_healthy
entrypoint: >
sh -c "mc alias set sheaf http://minio:9000 $${MINIO_ROOT_USER:-minioadmin} $${MINIO_ROOT_PASSWORD:-minioadmin} &&
mc mb --ignore-existing sheaf/$${S3_BUCKET:-sheaf-files} &&
mc anonymous set download sheaf/$${S3_BUCKET:-sheaf-files}"
volumes:
pgdata:
redisdata:
appdata:
miniodata: