-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.postgres.yml
More file actions
76 lines (73 loc) · 1.83 KB
/
Copy pathdocker-compose.postgres.yml
File metadata and controls
76 lines (73 loc) · 1.83 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
# Sublarr — PostgreSQL stack
#
# Usage:
# docker compose -f docker-compose.postgres.yml up -d
#
# On first run Postgres initialises an empty database. Sublarr runs Alembic
# migrations automatically on startup so no manual schema setup is needed.
#
# To migrate an existing SQLite database see docs/POSTGRESQL.md.
services:
postgres:
image: postgres:16-alpine
container_name: sublarr-postgres
environment:
POSTGRES_DB: sublarr
POSTGRES_USER: sublarr
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U sublarr -d sublarr"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped
security_opt:
- no-new-privileges:true
sublarr:
image: ghcr.io/abrechen2/sublarr:${VERSION:-latest}
build:
context: .
args:
VERSION: ${VERSION:-dev}
PUID: ${PUID:-1000}
PGID: ${PGID:-1000}
container_name: sublarr
depends_on:
postgres:
condition: service_healthy
ports:
- "127.0.0.1:${SUBLARR_PORT:-5765}:5765"
volumes:
- ./config:/config
- ${SUBLARR_MEDIA_PATH:-/media}:/media:rw
environment:
SUBLARR_DATABASE_URL: postgresql://sublarr:${POSTGRES_PASSWORD}@postgres/sublarr
read_only: true
tmpfs:
- /tmp
restart: unless-stopped
deploy:
resources:
limits:
cpus: '2.0'
memory: 4G
reservations:
cpus: '0.5'
memory: 512M
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
cap_add:
- CHOWN
- DAC_OVERRIDE
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
volumes:
postgres_data: