mirror of
https://github.com/photoprism/photoprism.git
synced 2026-07-17 16:49:04 +00:00
Develop: Honor WORKING_DIR in Dockerfile WORKDIR via compose build arg
This commit is contained in:
parent
9588d93aa4
commit
0544f71c12
5 changed files with 21 additions and 9 deletions
|
|
@ -18,8 +18,8 @@
|
||||||
|
|
||||||
# In-container working directory and bind mount target for the repo checkout.
|
# In-container working directory and bind mount target for the repo checkout.
|
||||||
# Override when the host clone lives outside the default GOPATH layout; the
|
# Override when the host clone lives outside the default GOPATH layout; the
|
||||||
# value is reused for working_dir, the source bind mount, and every PhotoPrism
|
# value is reused for the Dockerfile WORKDIR (build arg), working_dir, the
|
||||||
# path env var so they stay in sync.
|
# source bind mount, and every PhotoPrism path env var so they stay in sync.
|
||||||
# WORKING_DIR=/go/src/github.com/photoprism/photoprism
|
# WORKING_DIR=/go/src/github.com/photoprism/photoprism
|
||||||
|
|
||||||
# Network interfaces to which Traefik and other services bind on the host.
|
# Network interfaces to which Traefik and other services bind on the host.
|
||||||
|
|
|
||||||
11
Dockerfile
11
Dockerfile
|
|
@ -18,16 +18,19 @@ ENV NPM_CONFIG_IGNORE_SCRIPTS=true
|
||||||
# FROM photoprism/develop:bullseye # Debian 11 (Bullseye)
|
# FROM photoprism/develop:bullseye # Debian 11 (Bullseye)
|
||||||
# FROM photoprism/develop:buster # Debian 10 (Buster)
|
# FROM photoprism/develop:buster # Debian 10 (Buster)
|
||||||
|
|
||||||
# Set default working directory.
|
# Set default working directory. Override WORKING_DIR (e.g. via compose build
|
||||||
WORKDIR "/go/src/github.com/photoprism/photoprism"
|
# args populated from .env) to match a custom host-side clone layout; the value
|
||||||
|
# must stay aligned with compose's working_dir and the source bind mount target.
|
||||||
|
ARG WORKING_DIR=/go/src/github.com/photoprism/photoprism
|
||||||
|
WORKDIR "${WORKING_DIR}"
|
||||||
|
|
||||||
# Copy source to image.
|
# Copy source to image.
|
||||||
COPY . .
|
COPY . .
|
||||||
COPY --chown=root:root /scripts/dist/ /scripts/
|
COPY --chown=root:root ./scripts/dist/ /scripts/
|
||||||
|
|
||||||
# Re-install the dev "mariadb" client config so a custom MARIADB_PORT in .env
|
# Re-install the dev "mariadb" client config so a custom MARIADB_PORT in .env
|
||||||
# is honored even when the base image was built before the port=<n> line was
|
# is honored even when the base image was built before the port=<n> line was
|
||||||
# removed (no-op once the next dated base image picks up the new .my.cnf).
|
# removed (no-op once the next dated base image picks up the new .my.cnf).
|
||||||
COPY --chown=root:root --chmod=644 .my.cnf /etc/my.cnf
|
COPY --chown=root:root --chmod=644 ./.my.cnf /etc/my.cnf
|
||||||
|
|
||||||
RUN sudo /scripts/install-yt-dlp.sh
|
RUN sudo /scripts/install-yt-dlp.sh
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
services:
|
services:
|
||||||
## PhotoPrism (Development Environment for Intel QSV hardware transcoding)
|
## PhotoPrism (Development Environment for Intel QSV hardware transcoding)
|
||||||
photoprism:
|
photoprism:
|
||||||
build: .
|
build:
|
||||||
|
context: .
|
||||||
|
args:
|
||||||
|
WORKING_DIR: "${WORKING_DIR:-/go/src/github.com/photoprism/photoprism}"
|
||||||
image: photoprism/photoprism:develop
|
image: photoprism/photoprism:develop
|
||||||
depends_on:
|
depends_on:
|
||||||
- mariadb
|
- mariadb
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
services:
|
services:
|
||||||
## PhotoPrism (Development Environment for Nvidia)
|
## PhotoPrism (Development Environment for Nvidia)
|
||||||
photoprism:
|
photoprism:
|
||||||
build: .
|
build:
|
||||||
|
context: .
|
||||||
|
args:
|
||||||
|
WORKING_DIR: "${WORKING_DIR:-/go/src/github.com/photoprism/photoprism}"
|
||||||
image: photoprism/photoprism:develop
|
image: photoprism/photoprism:develop
|
||||||
runtime: nvidia
|
runtime: nvidia
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,10 @@
|
||||||
services:
|
services:
|
||||||
## PhotoPrism Build & Test Environment
|
## PhotoPrism Build & Test Environment
|
||||||
photoprism:
|
photoprism:
|
||||||
build: .
|
build:
|
||||||
|
context: .
|
||||||
|
args:
|
||||||
|
WORKING_DIR: "${WORKING_DIR:-/go/src/github.com/photoprism/photoprism}"
|
||||||
image: photoprism/photoprism:develop
|
image: photoprism/photoprism:develop
|
||||||
depends_on:
|
depends_on:
|
||||||
- mariadb
|
- mariadb
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue