2022-02-16 15:41:58 +01:00
|
|
|
#### Ubuntu 21.10 (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
|
|
|
|
ARG TARGETPLATFORM
|
2019-05-16 08:41:16 +02:00
|
|
|
ARG BUILD_TAG
|
2021-12-09 18:48:44 +01:00
|
|
|
ARG GOPROXY
|
2021-12-10 10:17:13 +01:00
|
|
|
ARG GODEBUG
|
2019-05-16 08:41:16 +02:00
|
|
|
|
2022-02-16 09:51:43 +01:00
|
|
|
# set environment variables
|
2021-05-15 14:05:52 +02:00
|
|
|
ENV 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" \
|
|
|
|
NODE_ENV="production" \
|
|
|
|
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 && \
|
|
|
|
useradd -m -U -u 1000 -d /photoprism photoprism && \
|
|
|
|
apt-get update && apt-get -qq dist-upgrade && apt-get -qq install --no-install-recommends \
|
2022-02-15 18:23:59 +01:00
|
|
|
apt-utils \
|
2022-02-17 13:45:43 +01:00
|
|
|
gpg \
|
2022-02-17 15:48:55 +01:00
|
|
|
gpg-agent \
|
2022-02-17 13:45:43 +01:00
|
|
|
pkg-config \
|
|
|
|
software-properties-common \
|
2021-02-26 11:06:20 +01:00
|
|
|
ca-certificates \
|
2022-02-15 18:23:59 +01:00
|
|
|
build-essential \
|
2022-02-16 15:41:58 +01:00
|
|
|
g++ \
|
|
|
|
gcc \
|
2022-02-15 18:23:59 +01:00
|
|
|
bash \
|
|
|
|
make \
|
|
|
|
nano \
|
2021-02-26 11:06:20 +01:00
|
|
|
wget \
|
2018-11-12 06:58:39 +01:00
|
|
|
curl \
|
2022-02-15 18:23:59 +01:00
|
|
|
git \
|
|
|
|
gettext \
|
2022-02-16 15:41:58 +01:00
|
|
|
firefox \
|
2022-02-15 18:23:59 +01:00
|
|
|
mariadb-client \
|
2021-02-26 11:06:20 +01:00
|
|
|
davfs2 \
|
2019-05-07 15:41:33 +02:00
|
|
|
chrpath \
|
2022-02-16 15:41:58 +01:00
|
|
|
libc6-dev \
|
2019-05-07 15:41:33 +02:00
|
|
|
libssl-dev \
|
|
|
|
libxft-dev \
|
|
|
|
libfreetype6 \
|
2018-11-12 06:58:39 +01:00
|
|
|
libfreetype6-dev \
|
2019-05-07 15:41:33 +02:00
|
|
|
libfontconfig1 \
|
|
|
|
libfontconfig1-dev \
|
2018-11-12 06:58:39 +01:00
|
|
|
libhdf5-serial-dev \
|
|
|
|
libpng-dev \
|
|
|
|
libzmq3-dev \
|
2020-08-25 14:57:45 +02:00
|
|
|
libx264-dev \
|
|
|
|
libx265-dev \
|
2021-10-21 18:36:04 +02:00
|
|
|
libnss3 \
|
|
|
|
libxtst6 \
|
2021-11-29 14:39:21 +01:00
|
|
|
librsvg2-bin \
|
2018-11-12 06:58:39 +01:00
|
|
|
rsync \
|
|
|
|
unzip \
|
2019-06-06 14:44:29 +02:00
|
|
|
zip \
|
2020-12-11 10:30:04 +01:00
|
|
|
sqlite3 \
|
2019-05-07 15:41:33 +02:00
|
|
|
tzdata \
|
2019-06-06 14:44:29 +02:00
|
|
|
libheif-examples \
|
2020-02-03 23:40:45 +01:00
|
|
|
exiftool \
|
2020-08-12 10:42:19 +02:00
|
|
|
rawtherapee \
|
2020-05-30 14:52:47 +02:00
|
|
|
ffmpeg \
|
2021-02-15 12:08:04 +01:00
|
|
|
ffmpegthumbnailer \
|
|
|
|
libavcodec-extra \
|
2020-08-13 15:10:50 +02:00
|
|
|
lsof \
|
2020-08-25 14:57:45 +02:00
|
|
|
apache2-utils \
|
2020-10-20 12:47:04 +02:00
|
|
|
fonts-roboto \
|
2021-06-02 11:04:31 +02:00
|
|
|
sudo && \
|
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-19 15:58:56 +01:00
|
|
|
/root/.local/bin/install-devtools.sh && \
|
|
|
|
/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 \
|
|
|
|
/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 && \
|
2020-10-20 12:47:04 +02:00
|
|
|
echo "photoprism ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
|
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"]
|