forked from cgnl/plex-postgresql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
92 lines (89 loc) · 3.04 KB
/
Copy pathdocker-compose.yml
File metadata and controls
92 lines (89 loc) · 3.04 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
services:
postgres:
image: postgres:15-alpine
container_name: plex-postgres
environment:
POSTGRES_USER: plex
POSTGRES_PASSWORD: plex
POSTGRES_DB: plex
volumes:
- postgres_data:/var/lib/postgresql/data
- postgres_socket:/var/run/postgresql
command: >
postgres
-c shared_buffers=256MB
-c work_mem=16MB
-c maintenance_work_mem=128MB
-c unix_socket_directories=/var/run/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U plex"]
interval: 5s
timeout: 5s
retries: 5
networks:
- plex-network
plex:
build:
context: .
dockerfile: Dockerfile
container_name: plex-postgresql
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Amsterdam
- VERSION=docker
# REQUIRED for first run: Get your claim token at https://plex.tv/claim
# Tokens expire after 4 minutes — generate one right before running 'docker compose up'
- PLEX_CLAIM=${PLEX_CLAIM:-}
# PostgreSQL configuration (TCP default)
- PLEX_PG_HOST=postgres
- PLEX_PG_PORT=5432
# For Unix socket mode, set PLEX_PG_HOST=/var/run/postgresql
- PLEX_PG_DATABASE=${PLEX_PG_DATABASE:-plex}
- PLEX_PG_USER=plex
- PLEX_PG_PASSWORD=plex
- PLEX_PG_SCHEMA=plex
- PLEX_PG_POOL_SIZE=50
- PLEX_PG_POOL_MAX=100
# - PLEX_PG_IDLE_TIMEOUT=300
# Translator output validation: off|sample|all (default off)
- PLEX_PG_VALIDATE_OUTPUT=${PLEX_PG_VALIDATE_OUTPUT:-off}
- PLEX_PG_VALIDATE_OUTPUT_SAMPLE_PCT=${PLEX_PG_VALIDATE_OUTPUT_SAMPLE_PCT:-5}
# Optional ARM override for OpenSSL CPU feature probing in some VMs/containers
# - PLEX_PG_OPENSSL_ARMCAP=0
# Logging: 0=ERROR, 1=INFO, 2=DEBUG
# Logging: 0/ERROR, 1/INFO, 2/DEBUG
- PLEX_PG_LOG_LEVEL=ERROR
- PLEX_PG_LOG_FILE=/config/plex_redirect_pg.log
- PLEX_PG_ENABLE_SIGNAL_LOG=1
# Clear log file on startup to avoid stale errors
- PLEX_PG_LOG_TRUNCATE_ON_START=1
volumes:
- plex_config:/config
- postgres_socket:/var/run/postgresql
# Media mount (default: local fixtures). Override in .env:
# PLEX_MEDIA_PATH=/absolute/path/to/your/real/media
- "${PLEX_MEDIA_PATH:-./fixtures/media}:/media:ro"
# Source Plex database for migration (mount your existing Plex database here)
# OPTIONAL: Uncomment and edit path to migrate from existing database
# - "${HOME}/Library/Application Support/Plex Media Server/Plug-in Support/Databases:/source-db:ro"
# Alternative custom media mount:
# - /path/to/media:/media:ro
ports:
- "${PLEX_HOST_PORT:-8080}:32400"
- "${PLEX_HOST_PORT:-8080}:32400/udp"
- "${PLEX_DLNA_PORT:-32470}:32469"
- "${PLEX_DLNA_PORT:-32470}:32469/udp"
# Skip 1900/udp - conflicts with local Plex
depends_on:
postgres:
condition: service_healthy
networks:
- plex-network
volumes:
postgres_data:
postgres_socket:
plex_config:
networks:
plex-network:
driver: bridge