2022-02-19 17:36:39 +01:00
|
|
|
#### Base Image: Ubuntu 21.10, Codename "Impish Indri"
|
2022-02-16 14:29:42 +01:00
|
|
|
FROM ubuntu:impish
|
2018-11-08 10:56:11 +01:00
|
|
|
|
2021-12-12 20:14:07 +01:00
|
|
|
LABEL maintainer="Michael Mayer <hello@photoprism.app>"
|
2018-11-08 10:56:11 +01:00
|
|
|
|
2021-06-02 11:04:31 +02:00
|
|
|
ARG TARGETARCH
|
2019-05-16 08:41:16 +02:00
|
|
|
ARG BUILD_TAG
|
|
|
|
|
2022-02-16 09:51:43 +01:00
|
|
|
# set environment variables
|
2022-02-20 12:23:06 +01:00
|
|
|
ENV DOCKER_ARCH=$TARGETARCH \
|
|
|
|
DOCKER_TAG=$BUILD_TAG \
|
|
|
|
DOCKER_ENV="develop" \
|
|
|
|
NODE_ENV="production" \
|
|
|
|
DEBIAN_FRONTEND="noninteractive" \
|
2021-10-22 14:18:17 +02:00
|
|
|
TMPDIR="/tmp" \
|
|
|
|
LD_LIBRARY_PATH="/root/.local/lib:/usr/local/lib:/usr/lib:/lib" \
|
|
|
|
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" \
|
|
|
|
GO111MODULE="on" \
|
|
|
|
CGO_CFLAGS="-g -O2 -Wno-return-local-addr"
|
2018-11-12 06:58:39 +01:00
|
|
|
|
2022-02-19 15:32:52 +01:00
|
|
|
# copy scripts and debian backports sources list
|
|
|
|
COPY --chown=root:root --chmod=755 /scripts/dist/* /root/.local/bin/
|
|
|
|
COPY --chown=root:root --chmod=755 /docker/develop/entrypoint.sh /entrypoint.sh
|
|
|
|
COPY --chown=root:root --chmod=644 /.my.cnf /etc/my.cnf
|
|
|
|
|
|
|
|
# update image and install build dependencies
|
2020-08-12 10:25:50 +02:00
|
|
|
RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry && \
|
|
|
|
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 && \
|
2022-02-19 15:32:52 +01:00
|
|
|
echo 'APT::Get::Fix-Missing "true";' > /etc/apt/apt.conf.d/80fixmissing && \
|
2022-02-25 16:33:46 +01:00
|
|
|
groupadd -f -r -g 44 video && groupadd -f -r -g 109 render && groupadd -f -g 1000 photoprism && \
|
|
|
|
useradd -m -g 1000 -u 1000 -d /photoprism -G video,render photoprism && \
|
2022-02-19 15:32:52 +01:00
|
|
|
apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-install-recommends \
|
2022-02-20 16:15:54 +01:00
|
|
|
apt-utils \
|
|
|
|
gpg \
|
|
|
|
gpg-agent \
|
|
|
|
pkg-config \
|
|
|
|
software-properties-common \
|
|
|
|
ca-certificates \
|
|
|
|
build-essential \
|
|
|
|
g++ \
|
|
|
|
gcc \
|
2022-02-25 16:33:46 +01:00
|
|
|
sudo \
|
2022-02-20 16:15:54 +01:00
|
|
|
bash \
|
|
|
|
make \
|
|
|
|
nano \
|
2022-02-25 16:33:46 +01:00
|
|
|
lsof \
|
|
|
|
lshw \
|
2022-02-20 16:15:54 +01:00
|
|
|
wget \
|
|
|
|
curl \
|
2022-02-25 16:33:46 +01:00
|
|
|
jq \
|
2022-02-20 16:15:54 +01:00
|
|
|
git \
|
2022-02-25 16:33:46 +01:00
|
|
|
zip \
|
|
|
|
unzip \
|
2022-02-20 16:15:54 +01:00
|
|
|
gettext \
|
|
|
|
firefox \
|
|
|
|
mariadb-client \
|
|
|
|
davfs2 \
|
|
|
|
chrpath \
|
|
|
|
libc6-dev \
|
|
|
|
libssl-dev \
|
|
|
|
libxft-dev \
|
|
|
|
libfreetype6 \
|
|
|
|
libfreetype6-dev \
|
|
|
|
libfontconfig1 \
|
|
|
|
libfontconfig1-dev \
|
|
|
|
libhdf5-serial-dev \
|
|
|
|
libpng-dev \
|
|
|
|
libzmq3-dev \
|
|
|
|
libx264-dev \
|
|
|
|
libx265-dev \
|
|
|
|
libnss3 \
|
|
|
|
libxtst6 \
|
|
|
|
librsvg2-bin \
|
|
|
|
rsync \
|
|
|
|
sqlite3 \
|
|
|
|
tzdata \
|
|
|
|
libheif-examples \
|
|
|
|
exiftool \
|
|
|
|
rawtherapee \
|
|
|
|
ffmpeg \
|
|
|
|
ffmpegthumbnailer \
|
|
|
|
libavcodec-extra \
|
|
|
|
apache2-utils \
|
|
|
|
fonts-roboto \
|
2022-02-25 16:33:46 +01:00
|
|
|
&& \
|
2022-02-17 13:54:42 +01:00
|
|
|
/root/.local/bin/install-nodejs.sh && \
|
2022-02-18 17:40:58 +01:00
|
|
|
/root/.local/bin/install-tensorflow.sh && \
|
|
|
|
/root/.local/bin/install-darktable.sh && \
|
2022-02-23 12:10:34 +01:00
|
|
|
/root/.local/bin/install-chrome.sh && \
|
2022-02-19 15:58:56 +01:00
|
|
|
/root/.local/bin/install-go.sh && \
|
2022-02-19 15:32:52 +01:00
|
|
|
/root/.local/bin/cleanup.sh && \
|
2021-08-05 11:09:26 +02:00
|
|
|
mkdir -p "/go/src" "/go/bin" && \
|
2022-02-19 15:32:52 +01:00
|
|
|
chmod -R 777 "/go" && \
|
|
|
|
install -d -m 0777 -o 1000 -g 1000 \
|
|
|
|
/var/lib/photoprism \
|
|
|
|
/tmp/photoprism \
|
|
|
|
/photoprism/originals \
|
|
|
|
/photoprism/import \
|
|
|
|
/photoprism/storage \
|
|
|
|
/photoprism/storage/sidecar \
|
|
|
|
/photoprism/storage/albums \
|
|
|
|
/photoprism/storage/backups \
|
|
|
|
/photoprism/storage/config \
|
2022-02-25 16:33:46 +01:00
|
|
|
/photoprism/storage/cache \
|
|
|
|
&& \
|
2021-12-12 20:15:52 +01:00
|
|
|
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
|
2018-11-08 16:41:14 +01:00
|
|
|
|
2022-02-15 18:23:59 +01:00
|
|
|
# install Go tools
|
2021-10-21 16:44:40 +02:00
|
|
|
RUN /usr/local/go/bin/go install github.com/tianon/gosu@latest && \
|
|
|
|
/usr/local/go/bin/go install golang.org/x/tools/cmd/goimports@latest && \
|
|
|
|
/usr/local/go/bin/go install github.com/kyoh86/richgo@latest && \
|
|
|
|
/usr/local/go/bin/go install github.com/psampaz/go-mod-outdated@latest && \
|
|
|
|
/usr/local/go/bin/go install github.com/dsoprea/go-exif/v3/command/exif-read-tool@latest; \
|
2022-02-19 15:32:52 +01:00
|
|
|
cp /go/bin/gosu /bin/gosu && \
|
|
|
|
echo "alias go=richgo ll='ls -alh'" > /photoprism/.bash_aliases && \
|
|
|
|
echo "alias go=richgo ll='ls -alh'" > /root/.bash_aliases && \
|
2022-02-20 14:43:16 +01:00
|
|
|
echo "ALL ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/all && \
|
2022-02-17 13:45:43 +01:00
|
|
|
cp /root/.local/bin/heif-convert.sh /usr/local/bin/heif-convert && \
|
2022-02-19 15:32:52 +01:00
|
|
|
chmod -R a+rwX /go
|
2020-05-09 11:00:22 +02:00
|
|
|
|
2022-02-15 18:23:59 +01:00
|
|
|
# set up project directory
|
2018-11-08 20:29:16 +01:00
|
|
|
WORKDIR "/go/src/github.com/photoprism/photoprism"
|
|
|
|
|
2022-02-19 15:32:52 +01:00
|
|
|
# expose the following container ports:
|
|
|
|
# - 2342 (HTTP)
|
|
|
|
# - 2343 (Acceptance Tests)
|
|
|
|
# - 9515 (Chromedriver)
|
|
|
|
# - 40000 (Go Debugger)
|
2022-02-15 18:23:59 +01:00
|
|
|
EXPOSE 2342 2343 9515 40000
|
2018-11-08 10:56:11 +01:00
|
|
|
|
2022-02-19 15:32:52 +01:00
|
|
|
# define container entrypoint script
|
2021-01-15 15:02:06 +01:00
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
|
|
|
2022-02-15 18:23:59 +01:00
|
|
|
# keep container running
|
2022-02-19 15:32:52 +01:00
|
|
|
CMD ["tail", "-f", "/dev/null"]
|