Skip to content

Commit

Permalink
Docker: Explicitly set HOME environment variable #1525
Browse files Browse the repository at this point in the history
  • Loading branch information
lastzero committed Sep 18, 2021
1 parent f7cc61e commit ed962a3
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 7 deletions.
10 changes: 5 additions & 5 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ steps:
- docker-compose -f docker-compose.drone.yml exec -T photoprism make all test install migrate
when:
branch:
- master
- preview
- release

- name: down
Expand All @@ -67,7 +67,7 @@ steps:
status:
- success
branch:
- master
- preview

- name: deploy-demo
environment:
Expand All @@ -83,7 +83,7 @@ steps:
status:
- success
branch:
- master
- preview

- name: deploy-release
environment:
Expand Down Expand Up @@ -139,7 +139,7 @@ name: linux-arm64

trigger:
branch:
- master
- preview
event:
exclude:
- pull_request
Expand Down Expand Up @@ -176,6 +176,6 @@ steps:

---
kind: signature
hmac: 7276095f851d0595a0471e4ec4249e14e7e809f0655883483bfafab2febaef6e
hmac: 0d3578ccf3d317b2db0b514ce2614bf4f943a971345176971bbab30cc624a1c5

...
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ FROM photoprism/development:20210831

# Set up project directory
WORKDIR "/go/src/github.com/photoprism/photoprism"
ENV HOME="/go/src/github.com/photoprism/photoprism"
COPY . .
1 change: 1 addition & 0 deletions docker-compose.drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ services:
PHOTOPRISM_THUMB_SIZE_UNCACHED: 7680 # On-demand rendering size limit (default 7680, min 720, max 7680)
PHOTOPRISM_JPEG_SIZE: 7680 # Size limit for converted image files in pixels (720-30000)
PHOTOPRISM_JPEG_QUALITY: 92 # Set to 95 for high-quality thumbnails (25-100)
HOME: "/photoprism"
CODECOV_TOKEN:
CODECOV_ENV:
CODECOV_URL:
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ services:
- "go-mod:/go/pkg/mod"
shm_size: "2gb"
environment:
TF_CPP_MIN_LOG_LEVEL: 0 # Show TensorFlow log messages for development
PHOTOPRISM_SITE_URL: "http://localhost:2342/"
PHOTOPRISM_SITE_TITLE: "PhotoPrism"
PHOTOPRISM_SITE_CAPTION: "Browse Your Life"
Expand Down Expand Up @@ -61,6 +60,8 @@ services:
PHOTOPRISM_THUMB_SIZE_UNCACHED: 7680 # On-demand rendering size limit (default 7680, min 720, max 7680)
PHOTOPRISM_JPEG_SIZE: 7680 # Size limit for converted image files in pixels (720-30000)
PHOTOPRISM_JPEG_QUALITY: 92 # Set to 95 for high-quality thumbnails (25-100)
TF_CPP_MIN_LOG_LEVEL: 0 # Show TensorFlow log messages for development
HOME: "/photoprism"

postgres:
image: postgres:12-alpine
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ services:
shm_size: "2gb"
environment:
UID: ${UID:-1000}
TF_CPP_MIN_LOG_LEVEL: 0 # Show TensorFlow log messages for development
PHOTOPRISM_SITE_URL: "http://localhost:2342/"
PHOTOPRISM_SITE_TITLE: "PhotoPrism"
PHOTOPRISM_SITE_CAPTION: "Browse Your Life"
Expand Down Expand Up @@ -62,6 +61,8 @@ services:
PHOTOPRISM_THUMB_SIZE_UNCACHED: 7680 # On-demand rendering size limit (default 7680, min 720, max 7680)
PHOTOPRISM_JPEG_SIZE: 7680 # Size limit for converted image files in pixels (720-30000)
PHOTOPRISM_JPEG_QUALITY: 92 # Set to 95 for high-quality thumbnails (25-100)
TF_CPP_MIN_LOG_LEVEL: 0 # Show TensorFlow log messages for development
HOME: "/photoprism"

mariadb:
image: mariadb:10.5
Expand Down
1 change: 1 addition & 0 deletions docker/development/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ RUN chmod 644 /root/.my.cnf /photoprism/.my.cnf

# Set up project directory
WORKDIR "/go/src/github.com/photoprism/photoprism"
ENV HOME="/go/src/github.com/photoprism/photoprism"

# Expose HTTP port 2342, 2343 plus 9515 for chromedriver
EXPOSE 2342 2343 9515
Expand Down
1 change: 1 addition & 0 deletions docker/examples/arm64/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ services:
PHOTOPRISM_SITE_CAPTION: "Browse Your Life"
PHOTOPRISM_SITE_DESCRIPTION: ""
PHOTOPRISM_SITE_AUTHOR: ""
HOME: "/photoprism"
# Set a non-root user, group, or custom umask if your Docker environment doesn't support this natively:
# UID: 1000
# GID: 1000
Expand Down
1 change: 1 addition & 0 deletions docker/examples/cloud/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,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
HOME: "/photoprism"
working_dir: "/photoprism"
volumes:
# Your photo and video files ([local path]:[container path]):
Expand Down
1 change: 1 addition & 0 deletions docker/examples/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ services:
PHOTOPRISM_SITE_CAPTION: "Browse Your Life"
PHOTOPRISM_SITE_DESCRIPTION: ""
PHOTOPRISM_SITE_AUTHOR: ""
HOME: "/photoprism"
# Set a non-root user, group, or custom umask if your Docker environment doesn't support this natively:
# UID: 1000
# GID: 1000
Expand Down
1 change: 1 addition & 0 deletions docker/examples/macos/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ services:
PHOTOPRISM_SITE_CAPTION: "Browse Your Life"
PHOTOPRISM_SITE_DESCRIPTION: ""
PHOTOPRISM_SITE_AUTHOR: ""
HOME: "/photoprism"
volumes:
# Your photo and video files ([local path]:[container path]):
- "~/Pictures:/photoprism/originals"
Expand Down
1 change: 1 addition & 0 deletions docker/examples/scheduler/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ services:
PHOTOPRISM_SITE_CAPTION: "Browse Your Life"
PHOTOPRISM_SITE_DESCRIPTION: ""
PHOTOPRISM_SITE_AUTHOR: ""
HOME: "/photoprism"
# Set a non-root user, group, or custom umask if your Docker environment doesn't support this natively:
# UID: 1000
# GID: 1000
Expand Down
1 change: 1 addition & 0 deletions docker/examples/sqlite/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ services:
PHOTOPRISM_SITE_CAPTION: "Browse Your Life"
PHOTOPRISM_SITE_DESCRIPTION: ""
PHOTOPRISM_SITE_AUTHOR: ""
HOME: "/photoprism"
# Set a non-root user, group, or custom umask if your Docker environment doesn't support this natively:
# UID: 1000
# GID: 1000
Expand Down
1 change: 1 addition & 0 deletions docker/examples/windows/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ services:
PHOTOPRISM_SITE_CAPTION: "Browse Your Life"
PHOTOPRISM_SITE_DESCRIPTION: ""
PHOTOPRISM_SITE_AUTHOR: ""
HOME: "/photoprism"
working_dir: "/photoprism"
volumes:
# Your photo and video files (multiple directories or drives can be indexed by mounting them as sub-folders):
Expand Down
1 change: 1 addition & 0 deletions docker/photoprism/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ RUN ldconfig
# Set default umask and create photoprism user
RUN umask 0000 && useradd photoprism -m -d /photoprism && chmod a+rwx /photoprism
WORKDIR /photoprism
ENV HOME="/photoprism"

# Copy files to /photoprism
COPY --from=build /root/.local/bin/photoprism /photoprism/bin/photoprism
Expand Down

0 comments on commit ed962a3

Please sign in to comment.