From 408ee3402d15fb518b6f9869846d5e967bcf0ec9 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Tue, 31 Aug 2021 14:30:15 +0200 Subject: [PATCH] Docker: Improve docs and add working_dir to docker-compose.yml --- docker-compose.postgres.yml | 1 + docker-compose.yml | 1 + docker/examples/arm64/docker-compose.yml | 8 ++++---- docker/examples/cloud/docker-compose.yml | 4 +++- docker/examples/docker-compose.yml | 8 ++++---- docker/examples/scheduler/docker-compose.yml | 8 ++++---- docker/examples/sqlite/docker-compose.yml | 8 ++++---- docker/examples/windows/docker-compose.yml | 1 + 8 files changed, 22 insertions(+), 17 deletions(-) diff --git a/docker-compose.postgres.yml b/docker-compose.postgres.yml index 7d1687f87..da999472e 100644 --- a/docker-compose.postgres.yml +++ b/docker-compose.postgres.yml @@ -12,6 +12,7 @@ services: ports: - "2342:2342" # Web Server (PhotoPrism) - "2343:2343" # Acceptance Tests + working_dir: "/go/src/github.com/photoprism/photoprism" volumes: - ".:/go/src/github.com/photoprism/photoprism" - "go-mod:/go/pkg/mod" diff --git a/docker-compose.yml b/docker-compose.yml index fce7e5094..494c9541b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,6 +25,7 @@ services: ports: - "2342:2342" # Web Server (PhotoPrism) - "2343:2343" # Acceptance Tests + working_dir: "/go/src/github.com/photoprism/photoprism" volumes: - ".:/go/src/github.com/photoprism/photoprism" - "go-mod:/go/pkg/mod" diff --git a/docker/examples/arm64/docker-compose.yml b/docker/examples/arm64/docker-compose.yml index e3cee5d01..f5c3e536b 100644 --- a/docker/examples/arm64/docker-compose.yml +++ b/docker/examples/arm64/docker-compose.yml @@ -40,6 +40,8 @@ services: security_opt: - seccomp:unconfined - apparmor:unconfined + # Run as a specific, non-root user (see https://docs.docker.com/engine/reference/run/#user): + # user: "1000" ports: - "2342:2342" # [local port]:[container port] environment: @@ -70,16 +72,14 @@ services: PHOTOPRISM_SITE_CAPTION: "Browse Your Life" PHOTOPRISM_SITE_DESCRIPTION: "" PHOTOPRISM_SITE_AUTHOR: "" - # You may optionally set a user / group id using environment variables if your Docker version or NAS does not - # support this natively (see next example): + # Set a non-root user, group, or custom umask if your Docker environment doesn't support this natively: # UID: 1000 # GID: 1000 # UMASK: 0000 - # Uncomment and edit the following line to set a specific user / group id (native): - # user: "1000:1000" # For hardware AVC transcoding using the h264_v4l2m2m encoder: # devices: # - "/dev/video11:/dev/video11" + working_dir: "/photoprism" volumes: # Your photo and video files ([local path]:[container path]): - "~/Pictures:/photoprism/originals" diff --git a/docker/examples/cloud/docker-compose.yml b/docker/examples/cloud/docker-compose.yml index a781c450e..c64683427 100644 --- a/docker/examples/cloud/docker-compose.yml +++ b/docker/examples/cloud/docker-compose.yml @@ -98,6 +98,8 @@ services: security_opt: - seccomp:unconfined - apparmor:unconfined + # Run as a specific, non-root user (see https://docs.docker.com/engine/reference/run/#user): + user: "1000" # Don't expose port when running behind Traefik reverse proxy! # ports: # - "2342:2342" # [local port]:[container port] @@ -140,7 +142,7 @@ services: PHOTOPRISM_DATABASE_NAME: "photoprism" # MariaDB database schema name PHOTOPRISM_DATABASE_USER: "photoprism" # MariaDB database user name PHOTOPRISM_DATABASE_PASSWORD: "_admin_password_" # MariaDB database user password - user: "1000" + working_dir: "/photoprism" volumes: # Your photo and video files ([local path]:[container path]): - "./originals:/photoprism/originals" diff --git a/docker/examples/docker-compose.yml b/docker/examples/docker-compose.yml index 162a02521..4a191d177 100644 --- a/docker/examples/docker-compose.yml +++ b/docker/examples/docker-compose.yml @@ -40,6 +40,8 @@ services: security_opt: - seccomp:unconfined - apparmor:unconfined + # Run as a specific, non-root user (see https://docs.docker.com/engine/reference/run/#user): + # user: "1000" ports: - "2342:2342" # [local port]:[container port] environment: @@ -67,13 +69,11 @@ services: PHOTOPRISM_SITE_CAPTION: "Browse Your Life" PHOTOPRISM_SITE_DESCRIPTION: "" PHOTOPRISM_SITE_AUTHOR: "" - # You may optionally set a user / group id using environment variables if your Docker version or NAS does not - # support this natively (see next example): + # Set a non-root user, group, or custom umask if your Docker environment doesn't support this natively: # UID: 1000 # GID: 1000 # UMASK: 0000 - # Uncomment and edit the following line to set a specific user / group id (native): - # user: "1000:1000" + working_dir: "/photoprism" volumes: # Your photo and video files ([local path]:[container path]): - "~/Pictures:/photoprism/originals" diff --git a/docker/examples/scheduler/docker-compose.yml b/docker/examples/scheduler/docker-compose.yml index 1bad1fd43..b5c6de7da 100644 --- a/docker/examples/scheduler/docker-compose.yml +++ b/docker/examples/scheduler/docker-compose.yml @@ -42,6 +42,8 @@ services: security_opt: - seccomp:unconfined - apparmor:unconfined + # Run as a specific, non-root user (see https://docs.docker.com/engine/reference/run/#user): + # user: "1000" ports: - "2342:2342" # [local port]:[container port] environment: @@ -69,13 +71,11 @@ services: PHOTOPRISM_SITE_CAPTION: "Browse Your Life" PHOTOPRISM_SITE_DESCRIPTION: "" PHOTOPRISM_SITE_AUTHOR: "" - # You may optionally set a user / group id using environment variables if your Docker version or NAS does not - # support this natively (see next example): + # Set a non-root user, group, or custom umask if your Docker environment doesn't support this natively: # UID: 1000 # GID: 1000 # UMASK: 0000 - # Uncomment and edit the following line to set a specific user / group id (native): - # user: "1000:1000" + working_dir: "/photoprism" volumes: # Your photo and video files ([local path]:[container path]): - "~/Pictures:/photoprism/originals" diff --git a/docker/examples/sqlite/docker-compose.yml b/docker/examples/sqlite/docker-compose.yml index 100a8aa79..abee0e348 100644 --- a/docker/examples/sqlite/docker-compose.yml +++ b/docker/examples/sqlite/docker-compose.yml @@ -40,6 +40,8 @@ services: security_opt: - seccomp:unconfined - apparmor:unconfined + # Run as a specific, non-root user (see https://docs.docker.com/engine/reference/run/#user): + # user: "1000" ports: - "2342:2342" # [local port]:[container port] environment: @@ -62,13 +64,11 @@ services: PHOTOPRISM_SITE_CAPTION: "Browse Your Life" PHOTOPRISM_SITE_DESCRIPTION: "" PHOTOPRISM_SITE_AUTHOR: "" - # You may optionally set a user / group id using environment variables if your Docker version or NAS does not - # support this natively (see next example): + # Set a non-root user, group, or custom umask if your Docker environment doesn't support this natively: # UID: 1000 # GID: 1000 # UMASK: 0000 - # Uncomment and edit the following line to set a specific user / group id (native): - # user: "1000:1000" + working_dir: "/photoprism" volumes: # Your photo and video files ([local path]:[container path]): - "~/Pictures:/photoprism/originals" diff --git a/docker/examples/windows/docker-compose.yml b/docker/examples/windows/docker-compose.yml index 7b02e7375..89d3ad5a9 100644 --- a/docker/examples/windows/docker-compose.yml +++ b/docker/examples/windows/docker-compose.yml @@ -67,6 +67,7 @@ services: PHOTOPRISM_SITE_CAPTION: "Browse Your Life" PHOTOPRISM_SITE_DESCRIPTION: "" PHOTOPRISM_SITE_AUTHOR: "" + working_dir: "/photoprism" volumes: # Your photo and video files (multiple directories or drives can be indexed by mounting them as sub-folders): - "~/Pictures:/photoprism/originals/Pictures"