-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathdocker-compose.postgres.yml
More file actions
68 lines (65 loc) · 2.41 KB
/
Copy pathdocker-compose.postgres.yml
File metadata and controls
68 lines (65 loc) · 2.41 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
# Questarr with a Postgres backend.
#
# The default docker-compose.yml uses SQLite and needs no database service --
# prefer it unless you specifically want Postgres. Switching an existing
# SQLite install to Postgres does not move your data on its own -- run
# scripts/sqlite-to-pg.ts to bring your library across. See docs/DATABASE.md.
#
# POSTGRES_PASSWORD must be safe to embed in a connection URL: stick to
# letters, digits, and avoid @ / : % # ? &. A hex string from
# `openssl rand -hex 32` is always safe.
#
# POSTGRES_PASSWORD=<something> docker compose -f docker-compose.postgres.yml up -d
services:
app:
image: ghcr.io/doezer/questarr:latest
ports:
- "${HOST_SIDE_PORT:-5000}:${CONTAINER_INTERNAL_SIDE_PORT:-5000}"
- "${SSL_PORT:-9898}:${SSL_PORT:-9898}"
environment:
- PORT=${CONTAINER_INTERNAL_SIDE_PORT:-5000}
- DB_DIALECT=postgres
- DATABASE_URL=postgres://questarr:${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD}@db:5432/questarr
# - DATABASE_POOL_MAX=10
# - QUESTARR_BASE_PATH=/Questarr # Serve from a subdirectory behind a reverse proxy, see docs/REVERSE_PROXY.md
volumes:
# Postgres owns your library data, but Questarr still stores config.yaml
# and other non-database state under /app/data -- keep this mount.
- ./data:/app/data
# Mount your root media/downloads folder here to allow atomic moves.
# Example (uncomment and adjust):
# - /mnt/user/data:/data
depends_on:
db:
condition: service_healthy
restart: unless-stopped
healthcheck:
test:
[
"CMD",
"node",
"-e",
"require('http').get('http://localhost:' + (process.env.PORT || 5000) + '/api/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1)).on('error', () => process.exit(1))",
]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
db:
image: postgres:17-alpine
environment:
- POSTGRES_USER=questarr
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD}
- POSTGRES_DB=questarr
volumes:
- questarr-pgdata:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
# The app waits on this, so it must pass before the first migration runs.
test: ["CMD-SHELL", "pg_isready -U questarr -d questarr"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
volumes:
questarr-pgdata: