2020-10-22 10:43:14 +13:00
|
|
|
# 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/>.
|
|
|
|
|
2019-11-29 08:34:33 +13:00
|
|
|
FROM python:3.8-slim-buster
|
2018-11-30 04:49:02 +13:00
|
|
|
|
2020-01-07 12:32:00 +13:00
|
|
|
ARG USER_ID=1000
|
|
|
|
ARG GROUP_ID=1000
|
|
|
|
|
|
|
|
ENV \
|
|
|
|
USER_ID=$USER_ID \
|
|
|
|
GROUP_ID=$GROUP_ID
|
|
|
|
|
2018-11-30 04:49:02 +13:00
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
2019-02-10 12:29:35 +13:00
|
|
|
COPY ./hydrus .
|
2019-05-19 03:53:59 +12:00
|
|
|
COPY ./deb .
|
2019-02-10 12:29:35 +13:00
|
|
|
|
2019-01-20 02:51:48 +13:00
|
|
|
RUN \
|
2019-08-19 22:11:59 +12:00
|
|
|
apt-get update && apt-get install --no-install-recommends -y \
|
2019-05-19 03:53:59 +12:00
|
|
|
build-essential \
|
2019-01-20 02:51:48 +13:00
|
|
|
ffmpeg \
|
2019-07-29 00:48:26 +12:00
|
|
|
multiarch-support \
|
2019-05-19 03:53:59 +12:00
|
|
|
wget && \
|
2019-07-29 00:48:26 +12:00
|
|
|
dpkg -i libjpeg8_8d-2_amd64.deb && \
|
|
|
|
rm libjpeg8_8d-2_amd64.deb && \
|
|
|
|
pip install --upgrade pip && \
|
2019-01-20 02:51:48 +13:00
|
|
|
pip install virtualenv && \
|
|
|
|
virtualenv venv && \
|
2019-05-19 03:53:59 +12:00
|
|
|
. venv/bin/activate && \
|
2019-01-20 02:51:48 +13:00
|
|
|
pip install \
|
2020-10-22 11:33:17 +13:00
|
|
|
beautifulsoup4~=4.9.3 \
|
2019-07-29 00:48:26 +12:00
|
|
|
chardet~=3.0.4 \
|
2020-09-08 06:09:38 +12:00
|
|
|
lz4~=3.1.0 \
|
2020-11-12 11:33:50 +13:00
|
|
|
numpy~=1.19.4 \
|
|
|
|
opencv-python-headless~=4.4.0.46 \
|
|
|
|
pillow~=8.0.1 \
|
|
|
|
psutil~=5.7.3 \
|
2019-01-20 02:51:48 +13:00
|
|
|
pylzma~=0.5.0 \
|
2019-11-29 08:34:33 +13:00
|
|
|
pyopenssl~=19.1.0 \
|
2020-04-17 06:58:59 +12:00
|
|
|
pyyaml~=5.3.1 \
|
2020-11-12 11:33:50 +13:00
|
|
|
requests~=2.25.0 \
|
2019-01-20 02:51:48 +13:00
|
|
|
send2trash~=1.5.0 \
|
|
|
|
service_identity~=18.1.0 \
|
2020-04-17 06:58:59 +12:00
|
|
|
twisted~=20.3.0 && \
|
2019-01-20 02:51:48 +13:00
|
|
|
rm -r ~/.cache && \
|
2019-08-19 22:11:59 +12:00
|
|
|
apt-get remove build-essential --purge -y && \
|
|
|
|
apt-get clean && apt-get autoremove --purge -y && \
|
2020-01-07 12:32:00 +13:00
|
|
|
rm -rf /var/lib/apt/lists/* && \
|
|
|
|
chown -R ${USER_ID}:${GROUP_ID} /usr/src/app && \
|
|
|
|
chmod +x \
|
|
|
|
server.py \
|
|
|
|
bin/swfrender_linux \
|
|
|
|
bin/upnpc_linux && \
|
|
|
|
mkdir /data && chown -R ${USER_ID}:${GROUP_ID} /data
|
2018-11-30 04:49:02 +13:00
|
|
|
|
2020-01-07 12:32:00 +13:00
|
|
|
COPY docker-cmd-start.sh /usr/local/bin/start
|
|
|
|
RUN chmod +x /usr/local/bin/start
|
2018-11-30 04:49:02 +13:00
|
|
|
|
2019-08-19 22:11:59 +12:00
|
|
|
EXPOSE 45870/tcp 45871/tcp 45872/tcp
|
2018-11-30 04:49:02 +13:00
|
|
|
|
2019-03-05 06:54:28 +13:00
|
|
|
HEALTHCHECK --interval=1m --timeout=10s --retries=3 \
|
|
|
|
CMD wget --quiet --tries=1 --no-check-certificate --spider \
|
|
|
|
https://localhost:45870 || exit 1
|
|
|
|
|
2019-03-25 00:53:53 +13:00
|
|
|
VOLUME /data
|
|
|
|
|
2020-01-07 12:32:00 +13:00
|
|
|
USER ${USER_ID}:${GROUP_ID}
|
|
|
|
|
|
|
|
CMD ["start"]
|