Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify running as non-root user using the env file and tmpfs #13834

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ services:
restart: always
healthcheck:
disable: false
user: ${UID:-0}:${GID:-0}

immich-machine-learning:
container_name: immich_machine_learning
Expand All @@ -38,20 +39,26 @@ services:
# extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
# file: hwaccel.ml.yml
# service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
volumes:
- model-cache:/cache
env_file:
- .env
restart: always
healthcheck:
disable: false
user: ${UID:-0}:${GID:-0}
tmpfs:
- /cache:mode=755,uid=${UID:-0},gid=${PID:-0} # model-cache
- /.config:mode=755,uid=${UID:-0},gid=${PID:-0}
- /.cache:mode=755,uid=${UID:-0},gid=${PID:-0}

redis:
container_name: immich_redis
image: docker.io/redis:6.2-alpine@sha256:2ba50e1ac3a0ea17b736ce9db2b0a9f6f8b85d4c27d5f5accc6a416d8f42c6d5
healthcheck:
test: redis-cli ping || exit 1
restart: always
user: ${UID:-0}:${GID:-0}
tmpfs:
- /data:mode=755,uid=${UID:-0},gid=${PID:-0}

database:
container_name: immich_postgres
Expand Down Expand Up @@ -86,6 +93,4 @@ services:
'wal_compression=on',
]
restart: always

volumes:
model-cache:
user: ${UID:-0}:${GID:-0}
5 changes: 5 additions & 0 deletions docker/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ IMMICH_VERSION=release
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=postgres

# The user and group given to the containers
# Uncomment to run as a non-root user
# UID=1000
# PID=1000

# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
Expand Down
Loading