mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
Docker: Refactor service initialization and reduce startup log verbosity
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -39,6 +39,7 @@ ENV PHOTOPRISM_ARCH=$TARGETARCH \
|
||||
CGO_CFLAGS="-g -O2 -Wno-return-local-addr" \
|
||||
PROG="photoprism" \
|
||||
S6_KEEP_ENV=1 \
|
||||
S6_VERBOSITY=0 \
|
||||
S6_LOGGING=0
|
||||
|
||||
# Copy scripts and package sources config.
|
||||
|
||||
@@ -33,7 +33,8 @@ ENV PHOTOPRISM_ARCH=$TARGETARCH \
|
||||
TF_ENABLE_ONEDNN_OPTS=1 \
|
||||
MALLOC_ARENA_MAX=4 \
|
||||
PROG="photoprism" \
|
||||
S6_KEEP_ENV=1 \
|
||||
S6_KEEP_ENV=0 \
|
||||
S6_VERBOSITY=0 \
|
||||
S6_LOGGING=0
|
||||
|
||||
# Copy scripts and package sources config.
|
||||
@@ -73,6 +74,8 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \
|
||||
/photoprism/storage/config \
|
||||
/photoprism/storage/cache && \
|
||||
/scripts/install-s6.sh && \
|
||||
ln -sf /scripts/services/photoprism /etc/s6-overlay/s6-rc.d/photoprism && \
|
||||
touch /etc/s6-overlay/s6-rc.d/user/contents.d/photoprism && \
|
||||
/scripts/cleanup.sh
|
||||
|
||||
# Set default working directory.
|
||||
@@ -83,4 +86,3 @@ EXPOSE 2342 2442 2443
|
||||
|
||||
# Set default entrypoint and command.
|
||||
ENTRYPOINT ["/init"]
|
||||
CMD ["/scripts/cmd.sh", "tail", "-f", "/dev/null"]
|
||||
@@ -39,6 +39,7 @@ ENV PHOTOPRISM_ARCH=$TARGETARCH \
|
||||
CGO_CFLAGS="-g -O2 -Wno-return-local-addr" \
|
||||
PROG="photoprism" \
|
||||
S6_KEEP_ENV=1 \
|
||||
S6_VERBOSITY=0 \
|
||||
S6_LOGGING=0
|
||||
|
||||
# Copy scripts and package sources config.
|
||||
|
||||
@@ -33,7 +33,8 @@ ENV PHOTOPRISM_ARCH=$TARGETARCH \
|
||||
TF_ENABLE_ONEDNN_OPTS=1 \
|
||||
MALLOC_ARENA_MAX=4 \
|
||||
PROG="photoprism" \
|
||||
S6_KEEP_ENV=1 \
|
||||
S6_KEEP_ENV=0 \
|
||||
S6_VERBOSITY=0 \
|
||||
S6_LOGGING=0
|
||||
|
||||
# Copy scripts and package sources config.
|
||||
@@ -74,6 +75,8 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \
|
||||
/photoprism/storage/config \
|
||||
/photoprism/storage/cache && \
|
||||
/scripts/install-s6.sh && \
|
||||
ln -sf /scripts/services/photoprism /etc/s6-overlay/s6-rc.d/photoprism && \
|
||||
touch /etc/s6-overlay/s6-rc.d/user/contents.d/photoprism && \
|
||||
/scripts/cleanup.sh
|
||||
|
||||
# Set default working directory.
|
||||
@@ -84,4 +87,3 @@ EXPOSE 2342 2442 2443
|
||||
|
||||
# Set default entrypoint and command.
|
||||
ENTRYPOINT ["/init"]
|
||||
CMD ["/scripts/cmd.sh", "tail", "-f", "/dev/null"]
|
||||
|
||||
@@ -39,6 +39,7 @@ ENV PHOTOPRISM_ARCH=$TARGETARCH \
|
||||
CGO_CFLAGS="-g -O2 -Wno-return-local-addr" \
|
||||
PROG="photoprism" \
|
||||
S6_KEEP_ENV=1 \
|
||||
S6_VERBOSITY=0 \
|
||||
S6_LOGGING=0
|
||||
|
||||
# Copy scripts and package sources config.
|
||||
|
||||
@@ -92,7 +92,8 @@ ENV PHOTOPRISM_ARCH=$TARGETARCH \
|
||||
PHOTOPRISM_AUTO_INDEX="300" \
|
||||
PHOTOPRISM_AUTO_IMPORT="-1" \
|
||||
PHOTOPRISM_INIT="https" \
|
||||
S6_KEEP_ENV=1 \
|
||||
S6_KEEP_ENV=0 \
|
||||
S6_VERBOSITY=0 \
|
||||
S6_LOGGING=0
|
||||
|
||||
# Copy dist files, scripts, and debian backports sources list.
|
||||
@@ -132,6 +133,8 @@ RUN echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80retries && \
|
||||
/photoprism/storage/config \
|
||||
/photoprism/storage/cache && \
|
||||
/scripts/install-s6.sh && \
|
||||
ln -sf /scripts/services/photoprism /etc/s6-overlay/s6-rc.d/photoprism && \
|
||||
touch /etc/s6-overlay/s6-rc.d/user/contents.d/photoprism && \
|
||||
/scripts/cleanup.sh
|
||||
|
||||
# Set default working directory.
|
||||
@@ -142,4 +145,3 @@ EXPOSE 2342 2443
|
||||
|
||||
# Set default entrypoint and command.
|
||||
ENTRYPOINT ["/init"]
|
||||
CMD ["/scripts/cmd.sh", "/opt/photoprism/bin/photoprism", "start"]
|
||||
|
||||
@@ -101,6 +101,3 @@ EXPOSE 2342 2443
|
||||
|
||||
# Copy app files.
|
||||
COPY --from=build --chown=root:root --chmod=755 /opt/photoprism/ /opt/photoprism
|
||||
|
||||
# Start app.
|
||||
CMD ["/scripts/cmd.sh", "/opt/photoprism/bin/photoprism", "start"]
|
||||
@@ -101,6 +101,3 @@ EXPOSE 2342 2443
|
||||
|
||||
# Copy app files.
|
||||
COPY --from=build --chown=root:root --chmod=755 /opt/photoprism/ /opt/photoprism
|
||||
|
||||
# Start app.
|
||||
CMD ["/scripts/cmd.sh", "/opt/photoprism/bin/photoprism", "start"]
|
||||
7
scripts/dist/install-s6.sh
vendored
7
scripts/dist/install-s6.sh
vendored
@@ -83,4 +83,11 @@ curl -fsSL "$S6_NOARCH_URL" | tar -C "${S6_OVERLAY_DESTDIR}" -Jxp
|
||||
echo "Extracting \"$S6_BINARY_URL\" to \"$S6_OVERLAY_DESTDIR\"..."
|
||||
curl -fsSL "$S6_BINARY_URL" | tar -C "${S6_OVERLAY_DESTDIR}" -Jxp
|
||||
|
||||
S6_USER2_BUNDLE="${S6_OVERLAY_DESTDIR}etc/s6-overlay/s6-rc.d/user2"
|
||||
|
||||
if [ -d "$S6_USER2_BUNDLE" ]; then
|
||||
echo "Removing \"${S6_USER2_BUNDLE}\"..."
|
||||
rm -rf "${S6_OVERLAY_DESTDIR}etc/s6-overlay/s6-rc.d/user2"
|
||||
fi
|
||||
|
||||
echo "Done."
|
||||
|
||||
0
scripts/dist/services/photoprism/dependencies.d/base
vendored
Normal file
0
scripts/dist/services/photoprism/dependencies.d/base
vendored
Normal file
3
scripts/dist/services/photoprism/run
vendored
Normal file
3
scripts/dist/services/photoprism/run
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/command/execlineb -P
|
||||
with-contenv
|
||||
/scripts/cmd.sh /opt/photoprism/bin/photoprism start
|
||||
1
scripts/dist/services/photoprism/type
vendored
Normal file
1
scripts/dist/services/photoprism/type
vendored
Normal file
@@ -0,0 +1 @@
|
||||
longrun
|
||||
Reference in New Issue
Block a user