From a1aab20897b115c6c3957e16ec744027eb4a08c5 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Thu, 26 Oct 2023 11:16:25 +0200 Subject: [PATCH] Develop: Add base image Dockerfiles for Ubuntu 23.10 (Mantic Minotaur) Signed-off-by: Michael Mayer --- docker/develop/mantic-slim/Dockerfile | 78 +++++++++++++++++ docker/develop/mantic/Dockerfile | 115 ++++++++++++++++++++++++++ docker/photoprism/mantic/Dockerfile | 114 +++++++++++++++++++++++++ 3 files changed, 307 insertions(+) create mode 100644 docker/develop/mantic-slim/Dockerfile create mode 100644 docker/develop/mantic/Dockerfile create mode 100644 docker/photoprism/mantic/Dockerfile diff --git a/docker/develop/mantic-slim/Dockerfile b/docker/develop/mantic-slim/Dockerfile new file mode 100644 index 000000000..fbba43c08 --- /dev/null +++ b/docker/develop/mantic-slim/Dockerfile @@ -0,0 +1,78 @@ +#### Base Image: Ubuntu 23.10 (Mantic Minotaur) +FROM ubuntu:mantic + +# Copyright © 2018 - 2023 PhotoPrism UG. All rights reserved. +# +# Questions? Email us at hello@photoprism.app or visit our website to learn +# more about our team, products and services: https://www.photoprism.app/ + +# Add Open Container Initiative (OCI) annotations. +# See: https://github.com/opencontainers/image-spec/blob/main/annotations.md +LABEL org.opencontainers.image.title="PhotoPrism® Base Image (Ubuntu 23.10)" +LABEL org.opencontainers.image.description="Ubuntu 23.10 (Mantic Minotaur)" +LABEL org.opencontainers.image.url="https://hub.docker.com/repository/docker/photoprism/develop" +LABEL org.opencontainers.image.source="https://github.com/photoprism/photoprism" +LABEL org.opencontainers.image.documentation="https://docs.photoprism.app/developer-guide/setup/" +LABEL org.opencontainers.image.authors="PhotoPrism UG " +LABEL org.opencontainers.image.vendor="PhotoPrism UG" + +# Declare build parameters. +ARG TARGETARCH +ARG BUILD_TAG + +# Set environment variables, see https://docs.photoprism.app/getting-started/config-options/. +ENV PHOTOPRISM_ARCH=$TARGETARCH \ + DOCKER_TAG=$BUILD_TAG \ + DOCKER_ENV="prod" \ + PS1="\u@$DOCKER_TAG:\w\$ " \ + PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/scripts:/opt/photoprism/bin" \ + LD_LIBRARY_PATH="/usr/local/lib:/usr/lib" \ + TMPDIR="/tmp" \ + DEBIAN_FRONTEND="noninteractive" \ + TF_CPP_MIN_LOG_LEVEL="2" \ + PROG="photoprism" + +# Copy scripts and package sources config. +COPY --chown=root:root --chmod=755 /scripts/dist/ /scripts/ + +# Update base image and add dependencies. +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 && \ + echo 'force-confold' > /etc/dpkg/dpkg.cfg.d/force-confold && \ + apt-get update && apt-get -qq dist-upgrade && \ + apt-get -qq install \ + libc6 ca-certificates bash sudo nano avahi-utils jq lsof lshw libebml5 libgav1-bin libatomic1 \ + exiftool sqlite3 tzdata gpg make zip unzip wget curl rsync imagemagick libvips-dev rawtherapee \ + ffmpeg libffmpeg-nvenc-dev libswscale-dev libavfilter-extra libavformat-extra libavcodec-extra \ + x264 x265 libde265-dev libaom3 libvpx7 libwebm1 libjpeg8 libmatroska7 libdvdread8 \ + && \ + /scripts/install-mariadb.sh mariadb-client && \ + /scripts/install-darktable.sh && \ + /scripts/install-libheif.sh && \ + echo 'alias ll="ls -alh"' >> /etc/skel/.bashrc && \ + echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/skel/.bashrc && \ + echo "ALL ALL=(ALL) NOPASSWD:SETENV: /scripts/entrypoint-init.sh" >> /etc/sudoers.d/init && \ + cp /etc/skel/.bashrc /root/.bashrc && \ + /scripts/create-users.sh && \ + install -d -m 0777 -o 1000 -g 1000 \ + /photoprism/originals \ + /photoprism/import \ + /photoprism/storage \ + /photoprism/storage/sidecar \ + /photoprism/storage/albums \ + /photoprism/storage/backups \ + /photoprism/storage/config \ + /photoprism/storage/cache && \ + /scripts/cleanup.sh + +# Default working directory. +WORKDIR /photoprism + +# Expose HTTP and HTTPS ports. +EXPOSE 2342 2442 2443 + +# Keep container running. +CMD ["tail", "-f", "/dev/null"] diff --git a/docker/develop/mantic/Dockerfile b/docker/develop/mantic/Dockerfile new file mode 100644 index 000000000..b10ead95f --- /dev/null +++ b/docker/develop/mantic/Dockerfile @@ -0,0 +1,115 @@ +#### Base Image: Ubuntu 23.10 (Mantic Minotaur) +FROM ubuntu:mantic + +# Copyright © 2018 - 2023 PhotoPrism UG. All rights reserved. +# +# Questions? Email us at hello@photoprism.app or visit our website to learn +# more about our team, products and services: https://www.photoprism.app/ + +# Add Open Container Initiative (OCI) annotations. +# See: https://github.com/opencontainers/image-spec/blob/main/annotations.md +LABEL org.opencontainers.image.title="PhotoPrism® Build Image (Ubuntu 23.10)" +LABEL org.opencontainers.image.description="Ubuntu 23.10 (Mantic Minotaur)" +LABEL org.opencontainers.image.url="https://hub.docker.com/repository/docker/photoprism/develop" +LABEL org.opencontainers.image.source="https://github.com/photoprism/photoprism" +LABEL org.opencontainers.image.documentation="https://docs.photoprism.app/developer-guide/setup/" +LABEL org.opencontainers.image.authors="PhotoPrism UG " +LABEL org.opencontainers.image.vendor="PhotoPrism UG" + +# Declare build parameters. +ARG TARGETARCH +ARG BUILD_TAG + +# Set environment variables, see https://docs.photoprism.app/getting-started/config-options/. +ENV PHOTOPRISM_ARCH=$TARGETARCH \ + DOCKER_TAG=$BUILD_TAG \ + DOCKER_ENV="develop" \ + NODE_ENV="production" \ + PS1="\u@$DOCKER_TAG:\w\$ " \ + PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/scripts:/usr/local/go/bin:/go/bin:/opt/photoprism/bin" \ + LD_LIBRARY_PATH="/usr/local/lib:/usr/lib" \ + DEBIAN_FRONTEND="noninteractive" \ + TMPDIR="/tmp" \ + TF_CPP_MIN_LOG_LEVEL="0" \ + GOPATH="/go" \ + GOBIN="/usr/local/bin" \ + GO111MODULE="on" \ + CGO_CFLAGS="-g -O2 -Wno-return-local-addr" \ + PROG="photoprism" + +# Copy scripts and package sources config. +COPY --chown=root:root --chmod=755 /scripts/dist/ /scripts/ +COPY --chown=root:root --chmod=644 /.my.cnf /etc/my.cnf + +# Update base image and add dependencies. +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 && \ + echo 'force-confold' > /etc/dpkg/dpkg.cfg.d/force-confold && \ + apt-get update && apt-get -qq dist-upgrade && \ + apt-get -qq install \ + libc6 ca-certificates bash sudo nano avahi-utils jq lsof lshw libebml5 libgav1-bin libatomic1 \ + exiftool sqlite3 tzdata gpg make zip unzip wget curl rsync imagemagick libvips-dev rawtherapee \ + ffmpeg libffmpeg-nvenc-dev libswscale-dev libavfilter-extra libavformat-extra libavcodec-extra \ + x264 x265 libde265-dev libaom3 libvpx7 libwebm1 libjpeg8 libmatroska7 libdvdread8 \ + && \ + apt-get -qq install \ + apt-utils pkg-config software-properties-common \ + build-essential gcc g++ git gettext davfs2 chrpath apache2-utils \ + autoconf automake cmake libtool libjpeg8-dev \ + libx264-dev libx265-dev libaom-dev libvpx-dev libwebm-dev libpng-dev libxft-dev \ + libc6-dev libhdf5-serial-dev libzmq3-dev libssl-dev libnss3 \ + libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev fonts-roboto \ + librsvg2-bin ghostscript gsfonts \ + && \ + /scripts/install-nodejs.sh && \ + /scripts/install-mariadb.sh mariadb-client && \ + /scripts/install-tensorflow.sh && \ + /scripts/install-darktable.sh && \ + /scripts/install-libheif.sh && \ + /scripts/install-chrome.sh && \ + /scripts/install-go.sh && \ + /scripts/install-go-tools.sh && \ + echo 'alias go=richgo ll="ls -alh"' >> /etc/skel/.bashrc && \ + echo 'export PS1="\u@$DOCKER_TAG:\w\$ "' >> /etc/skel/.bashrc && \ + echo "ALL ALL=(ALL) NOPASSWD:SETENV: ALL" >> /etc/sudoers.d/all && \ + cp /etc/skel/.bashrc /root/.bashrc && \ + cp /scripts/convert/policy.xml /etc/ImageMagick-6/policy.xml && \ + /scripts/create-users.sh && \ + install -d -m 0777 -o 1000 -g 1000 \ + /photoprism/originals \ + /photoprism/import \ + /photoprism/storage \ + /photoprism/storage/sidecar \ + /photoprism/storage/albums \ + /photoprism/storage/backups \ + /photoprism/storage/config \ + /photoprism/storage/cache && \ + /scripts/cleanup.sh + +# Download models and testdata. +RUN mkdir /tmp/photoprism && \ + wget "https://dl.photoprism.app/tensorflow/nsfw.zip?${BUILD_TAG}" -O /tmp/photoprism/nsfw.zip && \ + wget "https://dl.photoprism.app/tensorflow/nasnet.zip?${BUILD_TAG}" -O /tmp/photoprism/nasnet.zip && \ + wget "https://dl.photoprism.app/tensorflow/facenet.zip?${BUILD_TAG}" -O /tmp/photoprism/facenet.zip && \ + wget "https://dl.photoprism.app/qa/testdata.zip?${BUILD_TAG}" -O /tmp/photoprism/testdata.zip + +# Default working directory. +WORKDIR "/go/src/github.com/photoprism/photoprism" + +# Expose the following container ports: +# - 2342 (HTTP) +# - 2343 (Acceptance Tests) +# - 2442 (HTTP) +# - 2443 (HTTPS) +# - 9515 (Chromedriver) +# - 40000 (Go Debugger) +EXPOSE 2342 2343 2442 2443 9515 40000 + +# Declare container entrypoint script. +ENTRYPOINT ["/scripts/entrypoint.sh"] + +# Keep container running. +CMD ["tail", "-f", "/dev/null"] diff --git a/docker/photoprism/mantic/Dockerfile b/docker/photoprism/mantic/Dockerfile new file mode 100644 index 000000000..b2e014c58 --- /dev/null +++ b/docker/photoprism/mantic/Dockerfile @@ -0,0 +1,114 @@ +##################################################### BUILD STAGE ###################################################### +FROM photoprism/develop:mantic as build + +# Copyright © 2018 - 2023 PhotoPrism UG. All rights reserved. +# +# Questions? Email us at hello@photoprism.app or visit our website to learn +# more about our team, products and services: https://www.photoprism.app/ + +# Declare build parameters. +ARG TARGETARCH +ARG TARGETPLATFORM +ARG BUILD_TAG + +# Copy source to image. +WORKDIR "/go/src/github.com/photoprism/photoprism" +COPY . . + +# Build app. +RUN make all install DESTDIR=/opt/photoprism + +################################################## PRODUCTION STAGE #################################################### +#### Base Image: Ubuntu 23.10 (Mantic Minotaur) +FROM photoprism/develop:mantic-slim + +# Add Open Container Initiative (OCI) annotations. +# See: https://github.com/opencontainers/image-spec/blob/main/annotations.md +LABEL org.opencontainers.image.title="PhotoPrism® (Ubuntu 23.10)" +LABEL org.opencontainers.image.description="Ubuntu 23.10 (Mantic Minotaur)" +LABEL org.opencontainers.image.url="https://hub.docker.com/r/photoprism/photoprism" +LABEL org.opencontainers.image.source="https://github.com/photoprism/photoprism" +LABEL org.opencontainers.image.documentation="https://docs.photoprism.app/getting-started/" +LABEL org.opencontainers.image.authors="PhotoPrism UG " +LABEL org.opencontainers.image.vendor="PhotoPrism UG" + +# Declare build parameters. +ARG TARGETARCH +ARG BUILD_TAG + +# Set environment variables, see https://docs.photoprism.app/getting-started/config-options/. +ENV PHOTOPRISM_ARCH=$TARGETARCH \ + DOCKER_TAG=$BUILD_TAG \ + DOCKER_ENV="prod" \ + TMPDIR="/tmp" \ + DEBIAN_FRONTEND="noninteractive" \ + TF_CPP_MIN_LOG_LEVEL="2" \ + PROG="photoprism" \ + PHOTOPRISM_ASSETS_PATH="/opt/photoprism/assets" \ + PHOTOPRISM_IMPORT_PATH="/photoprism/import" \ + PHOTOPRISM_ORIGINALS_PATH="/photoprism/originals" \ + PHOTOPRISM_STORAGE_PATH="/photoprism/storage" \ + PHOTOPRISM_BACKUP_PATH="/photoprism/storage/backups" \ + PHOTOPRISM_LOG_FILENAME="/photoprism/storage/photoprism.log" \ + PHOTOPRISM_PID_FILENAME="/photoprism/storage/photoprism.pid" \ + PHOTOPRISM_DEBUG="false" \ + PHOTOPRISM_PUBLIC="false" \ + PHOTOPRISM_READONLY="false" \ + PHOTOPRISM_UPLOAD_NSFW="true" \ + PHOTOPRISM_DETECT_NSFW="false" \ + PHOTOPRISM_EXPERIMENTAL="false" \ + PHOTOPRISM_SITE_URL="http://localhost:2342/" \ + PHOTOPRISM_SITE_CAPTION="AI-Powered Photos App" \ + PHOTOPRISM_SITE_DESCRIPTION="" \ + PHOTOPRISM_SITE_AUTHOR="" \ + PHOTOPRISM_HTTP_HOST="0.0.0.0" \ + PHOTOPRISM_HTTP_PORT=2342 \ + PHOTOPRISM_DATABASE_DRIVER="sqlite" \ + PHOTOPRISM_DATABASE_SERVER="" \ + PHOTOPRISM_DATABASE_NAME="photoprism" \ + PHOTOPRISM_DATABASE_USER="photoprism" \ + PHOTOPRISM_DATABASE_PASSWORD="" \ + PHOTOPRISM_DISABLE_CHOWN="false" \ + PHOTOPRISM_DISABLE_WEBDAV="false" \ + PHOTOPRISM_DISABLE_SETTINGS="false" \ + PHOTOPRISM_DISABLE_BACKUPS="false" \ + PHOTOPRISM_DISABLE_EXIFTOOL="false" \ + PHOTOPRISM_DISABLE_PLACES="false" \ + PHOTOPRISM_DISABLE_TENSORFLOW="false" \ + PHOTOPRISM_DISABLE_FACES="false" \ + PHOTOPRISM_DISABLE_CLASSIFICATION="false" \ + PHOTOPRISM_RAW_PRESETS="false" \ + PHOTOPRISM_THUMB_FILTER="lanczos" \ + PHOTOPRISM_THUMB_UNCACHED="false" \ + PHOTOPRISM_THUMB_SIZE=2048 \ + PHOTOPRISM_THUMB_SIZE_UNCACHED=7680 \ + PHOTOPRISM_JPEG_SIZE=7680 \ + PHOTOPRISM_JPEG_QUALITY=85 \ + PHOTOPRISM_WORKERS=0 \ + PHOTOPRISM_WAKEUP_INTERVAL=900 \ + PHOTOPRISM_AUTO_INDEX=300 \ + PHOTOPRISM_AUTO_IMPORT=300 \ + PHOTOPRISM_INIT="https" + +# Copy scripts. +COPY --chown=root:root --chmod=755 /scripts/dist/ /scripts/ + +# Update pre-installed packages. +RUN apt-get update && \ + apt-get -qq dist-upgrade && \ + /scripts/cleanup.sh + +# Default working directory. +WORKDIR /photoprism + +# Expose HTTP(S) ports. +EXPOSE 2342 2443 + +# Copy app files. +COPY --from=build --chown=root:root --chmod=755 /opt/photoprism/ /opt/photoprism + +# Declare container entrypoint script. +ENTRYPOINT ["/scripts/entrypoint.sh"] + +# Start app. +CMD ["/opt/photoprism/bin/photoprism", "start"]