mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
Docker: Move init scripts to /scripts and rename $DOCKER_ARCH #2076
DOCKER_ARCH has been renamed to PHOTOPRISM_ARCH as it can be used for installing deps outside of Docker environments as well.
This commit is contained in:
@@ -36,7 +36,7 @@ if [[ -z $(swapon --show) ]]; then
|
||||
fi
|
||||
|
||||
# set apt defaults
|
||||
echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
||||
echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \
|
||||
echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/80recommends && \
|
||||
echo 'APT::Install-Suggests "false";' > /etc/apt/apt.conf.d/80suggests && \
|
||||
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \
|
||||
|
||||
@@ -7,7 +7,7 @@ ARG TARGETARCH
|
||||
ARG BUILD_TAG
|
||||
|
||||
# set environment variables
|
||||
ENV DOCKER_ARCH=$TARGETARCH \
|
||||
ENV PHOTOPRISM_ARCH=$TARGETARCH \
|
||||
DOCKER_TAG=$BUILD_TAG \
|
||||
DOCKER_ENV="develop" \
|
||||
NODE_ENV="production" \
|
||||
@@ -17,17 +17,17 @@ ENV DOCKER_ARCH=$TARGETARCH \
|
||||
TF_CPP_MIN_LOG_LEVEL="0" \
|
||||
GOPATH="/go" \
|
||||
GOBIN="/go/bin" \
|
||||
PATH="/go/bin:/usr/local/go/bin:~/.local/bin:/root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
|
||||
PATH="/scripts:/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
|
||||
GO111MODULE="on" \
|
||||
CGO_CFLAGS="-g -O2 -Wno-return-local-addr"
|
||||
|
||||
# copy scripts and debian backports sources list
|
||||
COPY --chown=root:root --chmod=755 /scripts/dist/* /root/.local/bin/
|
||||
COPY --chown=root:root --chmod=755 /scripts/dist/* /scripts/
|
||||
COPY --chown=root:root --chmod=644 /docker/develop/bullseye/sources.list /etc/apt/sources.list.d/bullseye.list
|
||||
COPY --chown=root:root --chmod=644 /.my.cnf /etc/my.cnf
|
||||
|
||||
# update image and install build dependencies
|
||||
RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
||||
RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \
|
||||
echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/80recommends && \
|
||||
echo 'APT::Install-Suggests "false";' > /etc/apt/apt.conf.d/80suggests && \
|
||||
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \
|
||||
@@ -82,10 +82,10 @@ RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
||||
ffmpegthumbnailer \
|
||||
libavcodec-extra \
|
||||
&& \
|
||||
/root/.local/bin/install-nodejs.sh && \
|
||||
/root/.local/bin/install-tensorflow.sh && \
|
||||
/root/.local/bin/install-go.sh && \
|
||||
/root/.local/bin/cleanup.sh && \
|
||||
/scripts/install-nodejs.sh && \
|
||||
/scripts/install-tensorflow.sh && \
|
||||
/scripts/install-go.sh && \
|
||||
/scripts/cleanup.sh && \
|
||||
mkdir -p "/go/src" "/go/bin" && \
|
||||
chmod -R 777 "/go" && \
|
||||
install -d -m 0777 -o 1000 -g 1000 \
|
||||
@@ -111,8 +111,7 @@ RUN /usr/local/go/bin/go install github.com/tianon/gosu@latest; \
|
||||
echo "alias ll='ls -alh'" > /photoprism/.bash_aliases && \
|
||||
echo "alias ll='ls -alh'" > /root/.bash_aliases && \
|
||||
echo "ALL ALL=(ALL) NOPASSWD:SETENV: ALL" >> /etc/sudoers.d/all && \
|
||||
cp /root/.local/bin/heif-convert.sh /usr/local/bin/heif-convert && \
|
||||
cp /root/.local/bin/entrypoint.sh /entrypoint.sh && \
|
||||
cp /scripts/heif-convert.sh /usr/local/bin/heif-convert && \
|
||||
chmod -R a+rwX /go
|
||||
|
||||
# set up project directory
|
||||
@@ -126,7 +125,7 @@ WORKDIR "/go/src/github.com/photoprism/photoprism"
|
||||
EXPOSE 2342 2343 9515 40000
|
||||
|
||||
# set container entrypoint script
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
ENTRYPOINT ["/scripts/entrypoint.sh"]
|
||||
|
||||
# keep container running
|
||||
CMD ["tail", "-f", "/dev/null"]
|
||||
|
||||
@@ -7,20 +7,20 @@ ARG TARGETARCH
|
||||
ARG BUILD_TAG
|
||||
|
||||
# set environment variables, see https://docs.photoprism.app/getting-started/config-options/
|
||||
ENV DOCKER_ARCH=$TARGETARCH \
|
||||
ENV PHOTOPRISM_ARCH=$TARGETARCH \
|
||||
DOCKER_TAG=$BUILD_TAG \
|
||||
DOCKER_ENV="develop" \
|
||||
PATH="/opt/photoprism/bin:/opt/photoprism/scripts:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin" \
|
||||
PATH="/scripts:/opt/photoprism/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin" \
|
||||
TMPDIR="/tmp" \
|
||||
DEBIAN_FRONTEND="noninteractive" \
|
||||
TF_CPP_MIN_LOG_LEVEL="2"
|
||||
|
||||
# copy scripts and debian backports sources list
|
||||
COPY /scripts/dist/ /opt/photoprism/scripts
|
||||
COPY /docker/develop/bullseye/sources.list /etc/apt/sources.list.d/bullseye.list
|
||||
COPY --chown=root:root --chmod=755 /scripts/dist/* /scripts/
|
||||
COPY --chown=root:root --chmod=644 /docker/develop/bullseye/sources.list /etc/apt/sources.list.d/bullseye.list
|
||||
|
||||
# install additional distribution packages
|
||||
RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
||||
RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \
|
||||
echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/80recommends && \
|
||||
echo 'APT::Install-Suggests "false";' > /etc/apt/apt.conf.d/80suggests && \
|
||||
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \
|
||||
@@ -50,8 +50,8 @@ RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
||||
ffmpegthumbnailer \
|
||||
libavcodec-extra \
|
||||
&& \
|
||||
install-mariadb.sh mariadb-client && \
|
||||
install-darktable.sh && \
|
||||
/scripts/install-mariadb.sh mariadb-client && \
|
||||
/scripts/install-darktable.sh && \
|
||||
install -d -m 0777 -o 1000 -g 1000 \
|
||||
/var/lib/photoprism \
|
||||
/tmp/photoprism \
|
||||
@@ -64,8 +64,8 @@ RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
||||
/photoprism/storage/config \
|
||||
/photoprism/storage/cache \
|
||||
&& \
|
||||
echo "ALL ALL=(ALL) NOPASSWD:SETENV: /opt/photoprism/scripts/entrypoint-init.sh" >> /etc/sudoers.d/init && \
|
||||
cleanup.sh
|
||||
echo "ALL ALL=(ALL) NOPASSWD:SETENV: /scripts/entrypoint-init.sh" >> /etc/sudoers.d/init && \
|
||||
/scripts/cleanup.sh
|
||||
|
||||
# define default directory and user
|
||||
WORKDIR /photoprism
|
||||
|
||||
@@ -7,7 +7,7 @@ ARG TARGETARCH
|
||||
ARG BUILD_TAG
|
||||
|
||||
# set environment variables
|
||||
ENV DOCKER_ARCH=$TARGETARCH \
|
||||
ENV PHOTOPRISM_ARCH=$TARGETARCH \
|
||||
DOCKER_TAG=$BUILD_TAG \
|
||||
DOCKER_ENV="develop" \
|
||||
NODE_ENV="production" \
|
||||
@@ -17,17 +17,17 @@ ENV DOCKER_ARCH=$TARGETARCH \
|
||||
TF_CPP_MIN_LOG_LEVEL="0" \
|
||||
GOPATH="/go" \
|
||||
GOBIN="/go/bin" \
|
||||
PATH="/go/bin:/usr/local/go/bin:~/.local/bin:/root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
|
||||
PATH="/scripts:/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
|
||||
GO111MODULE="on" \
|
||||
CGO_CFLAGS="-g -O2 -Wno-return-local-addr"
|
||||
|
||||
# copy scripts and debian backports sources list
|
||||
COPY --chown=root:root --chmod=755 /scripts/dist/* /root/.local/bin/
|
||||
COPY --chown=root:root --chmod=755 /scripts/dist/* /scripts/
|
||||
COPY --chown=root:root --chmod=644 /docker/develop/bullseye/sources.list /etc/apt/sources.list.d/bullseye.list
|
||||
COPY --chown=root:root --chmod=644 /.my.cnf /etc/my.cnf
|
||||
|
||||
# update image and install build dependencies
|
||||
RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
||||
RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \
|
||||
echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/80recommends && \
|
||||
echo 'APT::Install-Suggests "false";' > /etc/apt/apt.conf.d/80suggests && \
|
||||
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \
|
||||
@@ -88,11 +88,11 @@ RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
||||
chrpath \
|
||||
apache2-utils \
|
||||
&& \
|
||||
/root/.local/bin/install-nodejs.sh && \
|
||||
/root/.local/bin/install-mariadb.sh mariadb-client && \
|
||||
/root/.local/bin/install-tensorflow.sh && \
|
||||
/root/.local/bin/install-darktable.sh && \
|
||||
/root/.local/bin/cleanup.sh && \
|
||||
/scripts/install-nodejs.sh && \
|
||||
/scripts/install-mariadb.sh mariadb-client && \
|
||||
/scripts/install-tensorflow.sh && \
|
||||
/scripts/install-darktable.sh && \
|
||||
/scripts/cleanup.sh && \
|
||||
mkdir -p "/go/src" "/go/bin" && \
|
||||
chmod -R 777 "/go" && \
|
||||
install -d -m 0777 -o 1000 -g 1000 \
|
||||
@@ -122,8 +122,7 @@ RUN /usr/local/go/bin/go install github.com/tianon/gosu@latest && \
|
||||
echo "alias go=richgo ll='ls -alh'" > /photoprism/.bash_aliases && \
|
||||
echo "alias go=richgo ll='ls -alh'" > /root/.bash_aliases && \
|
||||
echo "ALL ALL=(ALL) NOPASSWD:SETENV: ALL" >> /etc/sudoers.d/all && \
|
||||
cp /root/.local/bin/heif-convert.sh /usr/local/bin/heif-convert && \
|
||||
cp /root/.local/bin/entrypoint.sh /entrypoint.sh && \
|
||||
cp /scripts/heif-convert.sh /usr/local/bin/heif-convert && \
|
||||
chmod -R a+rwX /go
|
||||
|
||||
# set up project directory
|
||||
@@ -137,7 +136,7 @@ WORKDIR "/go/src/github.com/photoprism/photoprism"
|
||||
EXPOSE 2342 2343 9515 40000
|
||||
|
||||
# set container entrypoint script
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
ENTRYPOINT ["/scripts/entrypoint.sh"]
|
||||
|
||||
# keep container running
|
||||
CMD ["tail", "-f", "/dev/null"]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
deb http://deb.debian.org/debian bullseye contrib non-free
|
||||
deb http://deb.debian.org/debian bullseye-updates contrib non-free
|
||||
deb http://deb.debian.org/debian bullseye-backports main contrib non-free
|
||||
deb http://ftp.de.debian.org/debian bullseye contrib non-free
|
||||
deb http://ftp.de.debian.org/debian bullseye-updates contrib non-free
|
||||
deb http://ftp.de.debian.org/debian bullseye-backports main contrib non-free
|
||||
deb http://security.debian.org/debian-security bullseye-security contrib non-free
|
||||
|
||||
@@ -7,7 +7,7 @@ ARG TARGETARCH
|
||||
ARG BUILD_TAG
|
||||
|
||||
# set environment variables
|
||||
ENV DOCKER_ARCH=$TARGETARCH \
|
||||
ENV PHOTOPRISM_ARCH=$TARGETARCH \
|
||||
DOCKER_TAG=$BUILD_TAG \
|
||||
DOCKER_ENV="develop" \
|
||||
NODE_ENV="production" \
|
||||
@@ -17,17 +17,17 @@ ENV DOCKER_ARCH=$TARGETARCH \
|
||||
TF_CPP_MIN_LOG_LEVEL="0" \
|
||||
GOPATH="/go" \
|
||||
GOBIN="/go/bin" \
|
||||
PATH="/go/bin:/usr/local/go/bin:~/.local/bin:/root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
|
||||
PATH="/scripts:/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
|
||||
GO111MODULE="on" \
|
||||
CGO_CFLAGS="-g -O2 -Wno-return-local-addr"
|
||||
|
||||
# copy scripts and debian backports sources list
|
||||
COPY --chown=root:root --chmod=755 /scripts/dist/* /root/.local/bin/
|
||||
COPY --chown=root:root --chmod=755 /scripts/dist/* /scripts/
|
||||
COPY --chown=root:root --chmod=644 /docker/develop/buster/sources.list /etc/apt/sources.list.d/buster.list
|
||||
COPY --chown=root:root --chmod=644 /.my.cnf /etc/my.cnf
|
||||
|
||||
# update image and install build dependencies
|
||||
RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
||||
RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \
|
||||
echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/80recommends && \
|
||||
echo 'APT::Install-Suggests "false";' > /etc/apt/apt.conf.d/80suggests && \
|
||||
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \
|
||||
@@ -88,10 +88,10 @@ RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
||||
chrpath \
|
||||
apache2-utils \
|
||||
&& \
|
||||
/root/.local/bin/install-nodejs.sh && \
|
||||
/root/.local/bin/install-tensorflow.sh && \
|
||||
/root/.local/bin/install-darktable.sh && \
|
||||
/root/.local/bin/cleanup.sh && \
|
||||
/scripts/install-nodejs.sh && \
|
||||
/scripts/install-tensorflow.sh && \
|
||||
/scripts/install-darktable.sh && \
|
||||
/scripts/cleanup.sh && \
|
||||
mkdir -p "/go/src" "/go/bin" && \
|
||||
chmod -R 777 "/go" && \
|
||||
install -d -m 0777 -o 1000 -g 1000 \
|
||||
@@ -121,8 +121,7 @@ RUN /usr/local/go/bin/go install github.com/tianon/gosu@latest && \
|
||||
echo "alias go=richgo ll='ls -alh'" > /photoprism/.bash_aliases && \
|
||||
echo "alias go=richgo ll='ls -alh'" > /root/.bash_aliases && \
|
||||
echo "ALL ALL=(ALL) NOPASSWD:SETENV: ALL" >> /etc/sudoers.d/all && \
|
||||
cp /root/.local/bin/heif-convert.sh /usr/local/bin/heif-convert && \
|
||||
cp /root/.local/bin/entrypoint.sh /entrypoint.sh && \
|
||||
cp /scripts/heif-convert.sh /usr/local/bin/heif-convert && \
|
||||
chmod -R a+rwX /go
|
||||
|
||||
# set up project directory
|
||||
@@ -136,7 +135,7 @@ WORKDIR "/go/src/github.com/photoprism/photoprism"
|
||||
EXPOSE 2342 2343 9515 40000
|
||||
|
||||
# set container entrypoint script
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
ENTRYPOINT ["/scripts/entrypoint.sh"]
|
||||
|
||||
# keep container running
|
||||
CMD ["tail", "-f", "/dev/null"]
|
||||
|
||||
@@ -7,7 +7,7 @@ ARG TARGETARCH
|
||||
ARG BUILD_TAG
|
||||
|
||||
# set environment variables
|
||||
ENV DOCKER_ARCH=$TARGETARCH \
|
||||
ENV PHOTOPRISM_ARCH=$TARGETARCH \
|
||||
DOCKER_TAG=$BUILD_TAG \
|
||||
DOCKER_ENV="develop" \
|
||||
NODE_ENV="production" \
|
||||
@@ -17,16 +17,16 @@ ENV DOCKER_ARCH=$TARGETARCH \
|
||||
TF_CPP_MIN_LOG_LEVEL="0" \
|
||||
GOPATH="/go" \
|
||||
GOBIN="/go/bin" \
|
||||
PATH="/go/bin:/usr/local/go/bin:~/.local/bin:/root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
|
||||
PATH="/scripts:/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" \
|
||||
GO111MODULE="on" \
|
||||
CGO_CFLAGS="-g -O2 -Wno-return-local-addr"
|
||||
|
||||
# copy scripts and debian backports sources list
|
||||
COPY --chown=root:root --chmod=755 /scripts/dist/* /root/.local/bin/
|
||||
COPY --chown=root:root --chmod=755 /scripts/dist/* /scripts/
|
||||
COPY --chown=root:root --chmod=644 /.my.cnf /etc/my.cnf
|
||||
|
||||
# update image and install build dependencies
|
||||
RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
||||
RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \
|
||||
echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/80recommends && \
|
||||
echo 'APT::Install-Suggests "false";' > /etc/apt/apt.conf.d/80suggests && \
|
||||
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \
|
||||
@@ -87,12 +87,12 @@ RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
||||
apache2-utils \
|
||||
fonts-roboto \
|
||||
&& \
|
||||
/root/.local/bin/install-nodejs.sh && \
|
||||
/root/.local/bin/install-tensorflow.sh && \
|
||||
/root/.local/bin/install-darktable.sh && \
|
||||
/root/.local/bin/install-chrome.sh && \
|
||||
/root/.local/bin/install-go.sh && \
|
||||
/root/.local/bin/cleanup.sh && \
|
||||
/scripts/install-nodejs.sh && \
|
||||
/scripts/install-tensorflow.sh && \
|
||||
/scripts/install-darktable.sh && \
|
||||
/scripts/install-chrome.sh && \
|
||||
/scripts/install-go.sh && \
|
||||
/scripts/cleanup.sh && \
|
||||
mkdir -p "/go/src" "/go/bin" && \
|
||||
chmod -R 777 "/go" && \
|
||||
install -d -m 0777 -o 1000 -g 1000 \
|
||||
@@ -122,8 +122,7 @@ RUN /usr/local/go/bin/go install github.com/tianon/gosu@latest && \
|
||||
echo "alias go=richgo ll='ls -alh'" > /photoprism/.bash_aliases && \
|
||||
echo "alias go=richgo ll='ls -alh'" > /root/.bash_aliases && \
|
||||
echo "ALL ALL=(ALL) NOPASSWD:SETENV: ALL" >> /etc/sudoers.d/all && \
|
||||
cp /root/.local/bin/heif-convert.sh /usr/local/bin/heif-convert && \
|
||||
cp /root/.local/bin/entrypoint.sh /entrypoint.sh && \
|
||||
cp /scripts/heif-convert.sh /usr/local/bin/heif-convert && \
|
||||
chmod -R a+rwX /go
|
||||
|
||||
# set up project directory
|
||||
@@ -137,7 +136,7 @@ WORKDIR "/go/src/github.com/photoprism/photoprism"
|
||||
EXPOSE 2342 2343 9515 40000
|
||||
|
||||
# set container entrypoint script
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
ENTRYPOINT ["/scripts/entrypoint.sh"]
|
||||
|
||||
# keep container running
|
||||
CMD ["tail", "-f", "/dev/null"]
|
||||
|
||||
@@ -28,7 +28,7 @@ if [[ -z $(swapon --show) ]]; then
|
||||
fi
|
||||
|
||||
# set apt defaults
|
||||
echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
||||
echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \
|
||||
echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/80recommends && \
|
||||
echo 'APT::Install-Suggests "false";' > /etc/apt/apt.conf.d/80suggests && \
|
||||
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \
|
||||
|
||||
@@ -21,10 +21,10 @@ ARG TARGETARCH
|
||||
ARG BUILD_TAG
|
||||
|
||||
# set environment variables, see https://docs.photoprism.app/getting-started/config-options/
|
||||
ENV DOCKER_ARCH=$TARGETARCH \
|
||||
ENV PHOTOPRISM_ARCH=$TARGETARCH \
|
||||
DOCKER_TAG=$BUILD_TAG \
|
||||
DOCKER_ENV="prod" \
|
||||
PATH="/opt/photoprism/bin:/opt/photoprism/scripts:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin" \
|
||||
PATH="/scripts:/opt/photoprism/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin" \
|
||||
TMPDIR="/tmp" \
|
||||
DEBIAN_FRONTEND="noninteractive" \
|
||||
TF_CPP_MIN_LOG_LEVEL="2" \
|
||||
@@ -74,16 +74,18 @@ ENV DOCKER_ARCH=$TARGETARCH \
|
||||
PHOTOPRISM_AUTO_INDEX=300 \
|
||||
PHOTOPRISM_AUTO_IMPORT=300
|
||||
|
||||
# copy app dist files and debian backports sources list
|
||||
# copy dist files and debian backports sources list
|
||||
COPY --from=build /opt/photoprism/ /opt/photoprism
|
||||
COPY /docker/develop/bullseye/sources.list /etc/apt/sources.list.d/bullseye.list
|
||||
|
||||
# install additional distribution packages
|
||||
RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
||||
RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \
|
||||
echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/80recommends && \
|
||||
echo 'APT::Install-Suggests "false";' > /etc/apt/apt.conf.d/80suggests && \
|
||||
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \
|
||||
echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing && \
|
||||
mv -f /opt/photoprism/scripts/ /scripts && \
|
||||
chown -R root:root /scripts && chmod -R 755 /scripts && \
|
||||
cp /opt/photoprism/bin/gosu /bin/gosu && \
|
||||
chown root:root /bin/gosu && \
|
||||
groupadd -f -r -g 44 video && groupadd -f -r -g 109 render && groupadd -f -g 1000 photoprism && \
|
||||
@@ -123,9 +125,8 @@ RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
||||
/photoprism/storage/config \
|
||||
/photoprism/storage/cache \
|
||||
&& \
|
||||
echo "ALL ALL=(ALL) NOPASSWD:SETENV: /opt/photoprism/scripts/entrypoint-init.sh" >> /etc/sudoers.d/init && \
|
||||
cp /opt/photoprism/scripts/entrypoint.sh /entrypoint.sh && \
|
||||
cleanup.sh
|
||||
echo "ALL ALL=(ALL) NOPASSWD:SETENV: /scripts/entrypoint-init.sh" >> /etc/sudoers.d/init && \
|
||||
/scripts/cleanup.sh
|
||||
|
||||
# define default directory and user
|
||||
WORKDIR /photoprism
|
||||
@@ -134,7 +135,7 @@ WORKDIR /photoprism
|
||||
EXPOSE 2342
|
||||
|
||||
# set container entrypoint script
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
ENTRYPOINT ["/scripts/entrypoint.sh"]
|
||||
|
||||
# start app server
|
||||
CMD ["/opt/photoprism/bin/photoprism", "start"]
|
||||
|
||||
@@ -21,10 +21,10 @@ ARG TARGETARCH
|
||||
ARG BUILD_TAG
|
||||
|
||||
# set environment variables, see https://docs.photoprism.app/getting-started/config-options/
|
||||
ENV DOCKER_ARCH=$TARGETARCH \
|
||||
ENV PHOTOPRISM_ARCH=$TARGETARCH \
|
||||
DOCKER_TAG=$BUILD_TAG \
|
||||
DOCKER_ENV="prod" \
|
||||
PATH="/opt/photoprism/bin:/opt/photoprism/scripts:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin" \
|
||||
PATH="/scripts:/opt/photoprism/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin" \
|
||||
TMPDIR="/tmp" \
|
||||
DEBIAN_FRONTEND="noninteractive" \
|
||||
TF_CPP_MIN_LOG_LEVEL="2" \
|
||||
@@ -75,7 +75,9 @@ ENV DOCKER_ARCH=$TARGETARCH \
|
||||
PHOTOPRISM_AUTO_IMPORT=300
|
||||
|
||||
# update pre-installed packages if needed
|
||||
RUN apt-get update && apt-get -qq dist-upgrade && cleanup.sh
|
||||
RUN apt-get update && \
|
||||
apt-get -qq dist-upgrade && \
|
||||
/scripts/cleanup.sh
|
||||
|
||||
# define default directory and user
|
||||
WORKDIR /photoprism
|
||||
@@ -83,12 +85,15 @@ WORKDIR /photoprism
|
||||
# expose default http port 2342
|
||||
EXPOSE 2342
|
||||
|
||||
# copy app dist files and debian backports sources list
|
||||
# copy dist files and debian backports sources list
|
||||
COPY --from=build /opt/photoprism/ /opt/photoprism
|
||||
RUN cp /opt/photoprism/scripts/entrypoint.sh /entrypoint.sh
|
||||
RUN cp -f /opt/photoprism/scripts/* /scripts/ && \
|
||||
chown -R root:root /scripts && \
|
||||
chmod -R 755 /scripts && \
|
||||
rm -rf /opt/photoprism/scripts
|
||||
|
||||
# set container entrypoint script
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
ENTRYPOINT ["/scripts/entrypoint.sh"]
|
||||
|
||||
# start app server
|
||||
CMD ["/opt/photoprism/bin/photoprism", "start"]
|
||||
|
||||
@@ -21,10 +21,10 @@ ARG TARGETARCH
|
||||
ARG BUILD_TAG
|
||||
|
||||
# set environment variables, see https://docs.photoprism.app/getting-started/config-options/
|
||||
ENV DOCKER_ARCH=$TARGETARCH \
|
||||
ENV PHOTOPRISM_ARCH=$TARGETARCH \
|
||||
DOCKER_TAG=$BUILD_TAG \
|
||||
DOCKER_ENV="prod" \
|
||||
PATH="/opt/photoprism/bin:/opt/photoprism/scripts:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin" \
|
||||
PATH="/scripts:/opt/photoprism/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin" \
|
||||
TMPDIR="/tmp" \
|
||||
DEBIAN_FRONTEND="noninteractive" \
|
||||
TF_CPP_MIN_LOG_LEVEL="2" \
|
||||
@@ -74,16 +74,18 @@ ENV DOCKER_ARCH=$TARGETARCH \
|
||||
PHOTOPRISM_AUTO_INDEX=300 \
|
||||
PHOTOPRISM_AUTO_IMPORT=300
|
||||
|
||||
# copy app dist files and debian backports sources list
|
||||
# copy dist files and debian backports sources list
|
||||
COPY --from=build /opt/photoprism/ /opt/photoprism
|
||||
COPY --chown=root:root --chmod=644 /docker/develop/buster/sources.list /etc/apt/sources.list.d/buster.list
|
||||
|
||||
# install additional distribution packages
|
||||
RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
||||
RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \
|
||||
echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/80recommends && \
|
||||
echo 'APT::Install-Suggests "false";' > /etc/apt/apt.conf.d/80suggests && \
|
||||
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \
|
||||
echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing && \
|
||||
mv -f /opt/photoprism/scripts/ /scripts && \
|
||||
chown -R root:root /scripts && chmod -R 755 /scripts && \
|
||||
cp /opt/photoprism/bin/gosu /bin/gosu && \
|
||||
chown root:root /bin/gosu && \
|
||||
groupadd -f -r -g 44 video && groupadd -f -r -g 109 render && groupadd -f -g 1000 photoprism && \
|
||||
@@ -111,7 +113,7 @@ RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
||||
ffmpegthumbnailer \
|
||||
libavcodec-extra \
|
||||
&& \
|
||||
install-darktable.sh && \
|
||||
/scripts/install-darktable.sh && \
|
||||
install -d -m 0777 -o 1000 -g 1000 \
|
||||
/var/lib/photoprism \
|
||||
/tmp/photoprism \
|
||||
@@ -124,9 +126,8 @@ RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
||||
/photoprism/storage/config \
|
||||
/photoprism/storage/cache \
|
||||
&& \
|
||||
echo "ALL ALL=(ALL) NOPASSWD:SETENV: /opt/photoprism/scripts/entrypoint-init.sh" >> /etc/sudoers.d/init && \
|
||||
cp /opt/photoprism/scripts/entrypoint.sh /entrypoint.sh && \
|
||||
cleanup.sh
|
||||
echo "ALL ALL=(ALL) NOPASSWD:SETENV: /scripts/entrypoint-init.sh" >> /etc/sudoers.d/init && \
|
||||
/scripts/cleanup.sh
|
||||
|
||||
# define default directory and user
|
||||
WORKDIR /photoprism
|
||||
@@ -135,7 +136,7 @@ WORKDIR /photoprism
|
||||
EXPOSE 2342
|
||||
|
||||
# set container entrypoint script
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
ENTRYPOINT ["/scripts/entrypoint.sh"]
|
||||
|
||||
# start app server
|
||||
CMD ["/opt/photoprism/bin/photoprism", "start"]
|
||||
|
||||
@@ -21,10 +21,10 @@ ARG TARGETARCH
|
||||
ARG BUILD_TAG
|
||||
|
||||
# set environment variables, see https://docs.photoprism.app/getting-started/config-options/
|
||||
ENV DOCKER_ARCH=$TARGETARCH \
|
||||
ENV PHOTOPRISM_ARCH=$TARGETARCH \
|
||||
DOCKER_TAG=$BUILD_TAG \
|
||||
DOCKER_ENV="prod" \
|
||||
PATH="/opt/photoprism/bin:/opt/photoprism/scripts:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin" \
|
||||
PATH="/scripts:/opt/photoprism/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin" \
|
||||
TMPDIR="/tmp" \
|
||||
DEBIAN_FRONTEND="noninteractive" \
|
||||
TF_CPP_MIN_LOG_LEVEL="2" \
|
||||
@@ -74,15 +74,17 @@ ENV DOCKER_ARCH=$TARGETARCH \
|
||||
PHOTOPRISM_AUTO_INDEX=300 \
|
||||
PHOTOPRISM_AUTO_IMPORT=300
|
||||
|
||||
# copy app dist files and debian backports sources list
|
||||
# copy dist files and debian backports sources list
|
||||
COPY --from=build /opt/photoprism/ /opt/photoprism
|
||||
|
||||
# install additional distribution packages
|
||||
RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
||||
RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \
|
||||
echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/80recommends && \
|
||||
echo 'APT::Install-Suggests "false";' > /etc/apt/apt.conf.d/80suggests && \
|
||||
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \
|
||||
echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing && \
|
||||
mv -f /opt/photoprism/scripts/ /scripts && \
|
||||
chown -R root:root /scripts && chmod -R 755 /scripts && \
|
||||
cp /opt/photoprism/bin/gosu /bin/gosu && \
|
||||
chown root:root /bin/gosu && \
|
||||
groupadd -f -r -g 44 video && groupadd -f -r -g 109 render && groupadd -f -g 1000 photoprism && \
|
||||
@@ -110,7 +112,7 @@ RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
||||
ffmpegthumbnailer \
|
||||
libavcodec-extra \
|
||||
&& \
|
||||
install-darktable.sh && \
|
||||
/scripts/install-darktable.sh && \
|
||||
install -d -m 0777 -o 1000 -g 1000 \
|
||||
/var/lib/photoprism \
|
||||
/tmp/photoprism \
|
||||
@@ -123,9 +125,8 @@ RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
||||
/photoprism/storage/config \
|
||||
/photoprism/storage/cache \
|
||||
&& \
|
||||
echo "ALL ALL=(ALL) NOPASSWD:SETENV: /opt/photoprism/scripts/entrypoint-init.sh" >> /etc/sudoers.d/init && \
|
||||
cp /opt/photoprism/scripts/entrypoint.sh /entrypoint.sh && \
|
||||
cleanup.sh
|
||||
echo "ALL ALL=(ALL) NOPASSWD:SETENV: /scripts/entrypoint-init.sh" >> /etc/sudoers.d/init && \
|
||||
/scripts/cleanup.sh
|
||||
|
||||
# define default directory and user
|
||||
WORKDIR /photoprism
|
||||
@@ -134,7 +135,7 @@ WORKDIR /photoprism
|
||||
EXPOSE 2342
|
||||
|
||||
# set container entrypoint script
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
ENTRYPOINT ["/scripts/entrypoint.sh"]
|
||||
|
||||
# start app server
|
||||
CMD ["/opt/photoprism/bin/photoprism", "start"]
|
||||
|
||||
@@ -7,7 +7,7 @@ ENV TMP /tmp
|
||||
ENV EXTRA_BAZEL_ARGS "--host_javabase=@local_jdk//:jdk"
|
||||
|
||||
# apt default settings
|
||||
RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
||||
RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \
|
||||
echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/80recommends && \
|
||||
echo 'APT::Install-Suggests "false";' > /etc/apt/apt.conf.d/80suggests && \
|
||||
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \
|
||||
|
||||
@@ -7,7 +7,7 @@ ENV TMP /tmp
|
||||
ENV EXTRA_BAZEL_ARGS "--host_javabase=@local_jdk//:jdk"
|
||||
|
||||
# apt default settings
|
||||
RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
||||
RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \
|
||||
echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/80recommends && \
|
||||
echo 'APT::Install-Suggests "false";' > /etc/apt/apt.conf.d/80suggests && \
|
||||
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/80forceyes && \
|
||||
|
||||
6
scripts/dist/arch.sh
vendored
6
scripts/dist/arch.sh
vendored
@@ -3,8 +3,8 @@
|
||||
# This script returns the normalized machine architecture (amd64, arm64, or arm).
|
||||
# An error is returned if the architecture is currently not supported by PhotoPrism.
|
||||
|
||||
if [[ $DOCKER_ARCH ]]; then
|
||||
SYSTEM_ARCH=$DOCKER_ARCH
|
||||
if [[ $PHOTOPRISM_ARCH ]]; then
|
||||
SYSTEM_ARCH=$PHOTOPRISM_ARCH
|
||||
elif [[ $OS == "Windows_NT" ]]; then
|
||||
if [[ $PROCESSOR_ARCHITEW6432 == "AMD64" || $PROCESSOR_ARCHITECTURE == "AMD64" ]]; then
|
||||
SYSTEM_ARCH=amd64
|
||||
@@ -13,7 +13,7 @@ elif [[ $OS == "Windows_NT" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
SYSTEM_ARCH=$(arch)
|
||||
SYSTEM_ARCH=$(uname -m)
|
||||
fi
|
||||
|
||||
BUILD_ARCH=${BUILD_ARCH:-$SYSTEM_ARCH}
|
||||
|
||||
12
scripts/dist/entrypoint-init.sh
vendored
12
scripts/dist/entrypoint-init.sh
vendored
@@ -14,9 +14,9 @@ re='^[0-9]+$'
|
||||
# detect environment
|
||||
case $DOCKER_ENV in
|
||||
prod)
|
||||
INIT_SCRIPTS="/opt/photoprism/scripts"
|
||||
CHOWN_DIRS=("${PHOTOPRISM_HOME}" "${PHOTOPRISM_DIST}")
|
||||
CHMOD_DIRS=("${PHOTOPRISM_DIST}")
|
||||
INIT_SCRIPTS="/scripts"
|
||||
CHOWN_DIRS=("/photoprism" "/opt/photoprism")
|
||||
CHMOD_DIRS=("/opt/photoprism")
|
||||
;;
|
||||
|
||||
develop)
|
||||
@@ -34,7 +34,7 @@ esac
|
||||
if [[ ${PHOTOPRISM_UID} =~ $re ]] && [[ ${PHOTOPRISM_UID} != "0" ]]; then
|
||||
if [[ ${PHOTOPRISM_GID} =~ $re ]] && [[ ${PHOTOPRISM_GID} != "0" ]]; then
|
||||
groupadd -g "${PHOTOPRISM_GID}" "group_${PHOTOPRISM_GID}" 2>/dev/null
|
||||
useradd -o -u "${PHOTOPRISM_UID}" -g "${PHOTOPRISM_GID}" -d "${PHOTOPRISM_HOME}" "user_${PHOTOPRISM_UID}" 2>/dev/null
|
||||
useradd -o -u "${PHOTOPRISM_UID}" -g "${PHOTOPRISM_GID}" -d "/photoprism" "user_${PHOTOPRISM_UID}" 2>/dev/null
|
||||
usermod -g "${PHOTOPRISM_GID}" "user_${PHOTOPRISM_UID}" 2>/dev/null
|
||||
|
||||
if [[ -z ${PHOTOPRISM_DISABLE_CHOWN} ]]; then
|
||||
@@ -44,7 +44,7 @@ if [[ ${PHOTOPRISM_UID} =~ $re ]] && [[ ${PHOTOPRISM_UID} != "0" ]]; then
|
||||
chmod --preserve-root -Rcf u+rwX "${CHMOD_DIRS[@]}"
|
||||
fi
|
||||
else
|
||||
useradd -o -u "${PHOTOPRISM_UID}" -g 1000 -d "${PHOTOPRISM_HOME}" "user_${PHOTOPRISM_UID}" 2>/dev/null
|
||||
useradd -o -u "${PHOTOPRISM_UID}" -g 1000 -d "/photoprism" "user_${PHOTOPRISM_UID}" 2>/dev/null
|
||||
usermod -g 1000 "user_${PHOTOPRISM_UID}" 2>/dev/null
|
||||
|
||||
if [[ -z ${PHOTOPRISM_DISABLE_CHOWN} ]]; then
|
||||
@@ -61,7 +61,7 @@ if [[ -z ${PHOTOPRISM_INIT} ]]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
INIT_LOCK="/root/.init-lock"
|
||||
INIT_LOCK="/scripts/.init-lock"
|
||||
|
||||
# execute targets via make
|
||||
if [[ ! -e ${INIT_LOCK} ]]; then
|
||||
|
||||
41
scripts/dist/entrypoint.sh
vendored
41
scripts/dist/entrypoint.sh
vendored
@@ -4,14 +4,14 @@
|
||||
re='^[0-9]+$'
|
||||
|
||||
# set env defaults
|
||||
export DOCKER_ARCH=${DOCKER_ARCH:-arch}
|
||||
export PHOTOPRISM_ARCH=${PHOTOPRISM_ARCH:-arch}
|
||||
export DOCKER_ENV=${DOCKER_ENV:-unknown}
|
||||
export DOCKER_TAG=${DOCKER_TAG:-unknown}
|
||||
|
||||
# detect environment
|
||||
case $DOCKER_ENV in
|
||||
prod)
|
||||
INIT_SCRIPT="/opt/photoprism/scripts/entrypoint-init.sh"
|
||||
INIT_SCRIPT="/scripts/entrypoint-init.sh"
|
||||
;;
|
||||
|
||||
develop)
|
||||
@@ -24,10 +24,6 @@ case $DOCKER_ENV in
|
||||
;;
|
||||
esac
|
||||
|
||||
# set home and install path defaults
|
||||
export PHOTOPRISM_HOME=${PHOTOPRISM_HOME:-/photoprism}
|
||||
export PHOTOPRISM_DIST=${PHOTOPRISM_DIST:-/opt/photoprism}
|
||||
|
||||
# normalize user and group ID environment variables
|
||||
if [[ -z ${PHOTOPRISM_UID} ]]; then
|
||||
if [[ ${UID} =~ $re ]] && [[ ${UID} != "0" ]]; then
|
||||
@@ -44,21 +40,24 @@ if [[ -z ${PHOTOPRISM_UID} ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# docker image info
|
||||
DOCKER_IMAGE="$PHOTOPRISM_ARCH-$DOCKER_ENV/$DOCKER_TAG"
|
||||
|
||||
# initialize container packages and permissions
|
||||
if [[ -f "${INIT_SCRIPT}" ]]; then
|
||||
if [[ $(id -u) == "0" ]]; then
|
||||
echo "init as root"
|
||||
echo "init $DOCKER_IMAGE as root"
|
||||
bash -c "${INIT_SCRIPT}"
|
||||
else
|
||||
echo "init as uid $(id -u)"
|
||||
echo "init $DOCKER_IMAGE as uid $(id -u)"
|
||||
sudo -E "${INIT_SCRIPT}"
|
||||
fi
|
||||
else
|
||||
echo "started as uid $(id -u)"
|
||||
echo "started $DOCKER_IMAGE as uid $(id -u)"
|
||||
fi
|
||||
|
||||
# set explicit home directory
|
||||
export HOME="${PHOTOPRISM_HOME}"
|
||||
export HOME="/photoprism"
|
||||
|
||||
# check for alternate umask variable
|
||||
if [[ -z ${PHOTOPRISM_UMASK} ]] && [[ ${UMASK} =~ $re ]] && [[ ${#UMASK} == 4 ]]; then
|
||||
@@ -72,11 +71,13 @@ else
|
||||
umask 0002
|
||||
fi
|
||||
|
||||
# show container info
|
||||
echo "image: $DOCKER_ARCH-$DOCKER_ENV, build $DOCKER_TAG"
|
||||
echo "home: ${PHOTOPRISM_HOME}"
|
||||
# display additional container info for troubleshooting
|
||||
echo "umask: \"$(umask)\" ($(umask -S))"
|
||||
echo "install-path: ${PHOTOPRISM_DIST}"
|
||||
echo "home-directory: ${HOME}"
|
||||
echo "storage-path: ${PHOTOPRISM_STORAGE_PATH}"
|
||||
echo "originals-path: ${PHOTOPRISM_ORIGINALS_PATH}"
|
||||
echo "import-path: ${PHOTOPRISM_IMPORT_PATH}"
|
||||
echo "assets-path: ${PHOTOPRISM_ASSETS_PATH}"
|
||||
|
||||
# change to another user and group on request
|
||||
if [[ $(id -u) == "0" ]] && [[ ${PHOTOPRISM_UID} =~ $re ]] && [[ ${PHOTOPRISM_UID} != "0" ]]; then
|
||||
@@ -86,23 +87,23 @@ if [[ $(id -u) == "0" ]] && [[ ${PHOTOPRISM_UID} =~ $re ]] && [[ ${PHOTOPRISM_UI
|
||||
echo "${@}"
|
||||
|
||||
# run command as uid:gid
|
||||
([[ ${DOCKER_ENV} != "prod" ]] || gosu "${PHOTOPRISM_UID}:${PHOTOPRISM_GID}" audit.sh) \
|
||||
&& gosu "${PHOTOPRISM_UID}:${PHOTOPRISM_GID}" "$@" &
|
||||
([[ ${DOCKER_ENV} != "prod" ]] || gosu "${PHOTOPRISM_UID}:${PHOTOPRISM_GID}" "/scripts/audit.sh") \
|
||||
&& gosu "${PHOTOPRISM_UID}:${PHOTOPRISM_GID}" "$@" &
|
||||
else
|
||||
echo "switching to uid ${PHOTOPRISM_UID}"
|
||||
echo "${@}"
|
||||
|
||||
# run command as uid
|
||||
([[ ${DOCKER_ENV} != "prod" ]] || gosu "${PHOTOPRISM_UID}" audit.sh) \
|
||||
&& gosu "${PHOTOPRISM_UID}" "$@" &
|
||||
([[ ${DOCKER_ENV} != "prod" ]] || gosu "${PHOTOPRISM_UID}" "/scripts/audit.sh") \
|
||||
&& gosu "${PHOTOPRISM_UID}" "$@" &
|
||||
fi
|
||||
else
|
||||
echo "running as uid $(id -u)"
|
||||
echo "${@}"
|
||||
|
||||
# run command
|
||||
([[ ${DOCKER_ENV} != "prod" ]] || audit.sh) \
|
||||
&& "$@" &
|
||||
([[ ${DOCKER_ENV} != "prod" ]] || "/scripts/audit.sh") \
|
||||
&& "$@" &
|
||||
fi
|
||||
|
||||
PID=$!
|
||||
|
||||
Reference in New Issue
Block a user