1
0
Fork 0
mirror of https://github.com/imtbl/hydrus-server-docker synced 2024-04-27 09:12:54 +12:00
hydrus-server-docker/Dockerfile
2021-02-24 18:26:49 +01:00

82 lines
2.2 KiB
Docker

# hydrus-server-docker
# Copyright (C) 2018-present imtbl https://github.com/imtbl
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
FROM python:3.9-slim-buster
ARG USER_ID=1000
ARG GROUP_ID=1000
ENV \
USER_ID=$USER_ID \
GROUP_ID=$GROUP_ID
WORKDIR /usr/src/app
COPY ./hydrus .
COPY ./deb .
RUN \
apt-get update && apt-get install --no-install-recommends -y \
build-essential \
ffmpeg \
multiarch-support \
wget && \
dpkg -i libjpeg8_8d-2_amd64.deb && \
rm libjpeg8_8d-2_amd64.deb && \
pip install --upgrade pip && \
pip install virtualenv && \
virtualenv venv && \
. venv/bin/activate && \
pip install \
beautifulsoup4~=4.9.3 \
chardet~=4.0.0 \
lz4~=3.1.3 \
numpy~=1.20.1 \
opencv-python-headless~=4.5.1.48 \
pillow~=8.1.0 \
psutil~=5.8.0 \
pylzma~=0.5.0 \
pyopenssl~=20.0.1 \
pyyaml~=5.4.1 \
requests~=2.25.1 \
send2trash~=1.5.0 \
service_identity~=18.1.0 \
twisted~=20.3.0 && \
rm -r ~/.cache && \
apt-get remove build-essential --purge -y && \
apt-get clean && apt-get autoremove --purge -y && \
rm -rf /var/lib/apt/lists/* && \
chown -R ${USER_ID}:${GROUP_ID} /usr/src/app && \
chmod +x \
server.py \
bin/swfrender_linux && \
mkdir /data && chown -R ${USER_ID}:${GROUP_ID} /data
COPY docker-cmd-start.sh /usr/local/bin/start
RUN chmod +x /usr/local/bin/start
EXPOSE 45870/tcp 45871/tcp 45872/tcp
HEALTHCHECK --interval=1m --timeout=10s --retries=3 \
CMD wget --quiet --tries=1 --no-check-certificate --spider \
https://localhost:45870 || exit 1
VOLUME /data
USER ${USER_ID}:${GROUP_ID}
CMD ["start"]