immich. Implementing optional DB port publishing.
All checks were successful
continuous-integration/drone/pr Build is passing

This commit is contained in:
Alexey Skobkin 2024-11-07 00:13:15 +03:00
parent 55328a932b
commit 33ee1abb46
Signed by: skobkin
GPG key ID: 4389E670595BF8A8
3 changed files with 16 additions and 0 deletions

View file

@ -3,6 +3,13 @@
BIND_ADDRESS=127.0.0.1
BIND_PORT=2283
# Available modes: shared, internal
# Shared allows to publish database ports on host which may be useful for a backup
# Internal mode leave the database inside the stack network
#DB_MODE=shared
#DB_EXTERNAL_ADDRESS=127.0.0.1
#DB_EXTERNAL_PORT=5430
# The location where your uploaded files are stored
UPLOAD_LOCATION=./library
MODEL_CACHE_LOCATION=./model-cache

View file

@ -71,6 +71,9 @@ services:
database:
container_name: immich_postgres
image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
extends:
file: 'share_db.yaml'
service: '${DB_MODE:-internal}' # set to one of [shared, internal]
environment:
POSTGRES_PASSWORD: '${DB_PASSWORD}'
POSTGRES_USER: '${DB_USERNAME}'

6
immich/share_db.yaml Normal file
View file

@ -0,0 +1,6 @@
services:
internal: {}
shared:
ports:
- '${DB_EXTERNAL_ADDRESS:-127.0.0.1}:${DB_EXTERNAL_PORT:-5430}:5432'