mirror of
https://github.com/imtbl/hydrus-server-docker
synced 2024-09-30 09:17:44 +13:00
Merge branch 'release/2.0.0'
This commit is contained in:
commit
ee8a37a365
4 changed files with 84 additions and 32 deletions
12
CHANGELOG.md
12
CHANGELOG.md
|
@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [2.0.0] - 2019-01-20
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
+ Updated hydrus server version
|
||||||
|
+ Updated setup to run hydrus server from source (instead of the pre-compiled
|
||||||
|
executable)
|
||||||
|
+ Switched base image to Alpine (instead of Debian)
|
||||||
|
|
||||||
## [1.4.1] - 2019-01-13
|
## [1.4.1] - 2019-01-13
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
@ -58,7 +67,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||||
|
|
||||||
+ Initial release
|
+ Initial release
|
||||||
|
|
||||||
[Unreleased]: https://github.com/mserajnik/hydrus-server-docker/compare/1.4.1...develop
|
[Unreleased]: https://github.com/mserajnik/hydrus-server-docker/compare/2.0.0...develop
|
||||||
|
[2.0.0]: https://github.com/mserajnik/hydrus-server-docker/compare/1.4.1...2.0.0
|
||||||
[1.4.1]: https://github.com/mserajnik/hydrus-server-docker/compare/1.4.0...1.4.1
|
[1.4.1]: https://github.com/mserajnik/hydrus-server-docker/compare/1.4.0...1.4.1
|
||||||
[1.4.0]: https://github.com/mserajnik/hydrus-server-docker/compare/1.3.0...1.4.0
|
[1.4.0]: https://github.com/mserajnik/hydrus-server-docker/compare/1.3.0...1.4.0
|
||||||
[1.3.0]: https://github.com/mserajnik/hydrus-server-docker/compare/1.2.0...1.3.0
|
[1.3.0]: https://github.com/mserajnik/hydrus-server-docker/compare/1.2.0...1.3.0
|
||||||
|
|
56
Dockerfile
56
Dockerfile
|
@ -1,4 +1,4 @@
|
||||||
FROM debian:stretch-slim
|
FROM python:3.7-alpine
|
||||||
|
|
||||||
ARG HOST_USER_ID=1000
|
ARG HOST_USER_ID=1000
|
||||||
ARG HOST_GROUP_ID=1000
|
ARG HOST_GROUP_ID=1000
|
||||||
|
@ -8,24 +8,56 @@ ENV HOST_GROUP_ID=$HOST_GROUP_ID
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
if [ $(getent group ${HOST_GROUP_ID}) ]; then \
|
if [ $(getent group ${HOST_GROUP_ID}) ]; then \
|
||||||
useradd -r -u ${HOST_USER_ID} hydrus; \
|
adduser -D -u ${HOST_USER_ID} hydrus; \
|
||||||
else \
|
else \
|
||||||
groupadd -g ${HOST_GROUP_ID} hydrus && \
|
addgroup -g ${HOST_GROUP_ID} hydrus && \
|
||||||
useradd -r -u ${HOST_USER_ID} -g hydrus hydrus; \
|
adduser -D -u ${HOST_USER_ID} -G hydrus hydrus; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN \
|
||||||
apt-get install -y ca-certificates ffmpeg wget --no-install-recommends && \
|
wget "https://github.com/hydrusnetwork/hydrus/archive/v336.tar.gz" && \
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
tar zxvf $(ls | grep ".tar.gz") --strip-components 1 && \
|
||||||
wget "https://github.com/hydrusnetwork/hydrus/releases/download/v334/Hydrus.Network.334.-.Linux.-.Executable.tar.gz" && \
|
rm $(ls | grep ".tar.gz") && \
|
||||||
tar zxvf $(ls | grep "Linux.-.Executable.tar.gz") --strip-components 1 && \
|
sed -i '/from include import HydrusPy2To3/d' ./server.py && \
|
||||||
rm $(ls | grep "Linux.-.Executable.tar.gz") && \
|
sed -i '/HydrusPy2To3.do_2to3_test()/d' ./server.py && \
|
||||||
chown -R hydrus:hydrus /usr/src/app && \
|
chown -R hydrus:hydrus /usr/src/app && \
|
||||||
|
chmod +x server.py && \
|
||||||
|
chmod +x bin/swfrender_linux bin/upnpc_linux && \
|
||||||
|
rm \
|
||||||
|
bin/swfrender_osx \
|
||||||
|
bin/swfrender_win32.exe \
|
||||||
|
bin/upnpc_osx \
|
||||||
|
bin/upnpc_win32.exe && \
|
||||||
mkdir /data && chown -R hydrus:hydrus /data && \
|
mkdir /data && chown -R hydrus:hydrus /data && \
|
||||||
apt-get remove ca-certificates wget -y && \
|
apk --no-cache add \
|
||||||
apt-get autoremove -y
|
build-base \
|
||||||
|
ffmpeg \
|
||||||
|
jpeg-dev \
|
||||||
|
libffi-dev \
|
||||||
|
linux-headers \
|
||||||
|
openssl \
|
||||||
|
openssl-dev && \
|
||||||
|
pip install virtualenv && \
|
||||||
|
virtualenv venv && \
|
||||||
|
source venv/bin/activate && \
|
||||||
|
pip install \
|
||||||
|
beautifulsoup4~=4.7.1 \
|
||||||
|
lz4~=2.1.6 \
|
||||||
|
numpy~=1.16.0 \
|
||||||
|
pillow~=5.4.1 \
|
||||||
|
psutil~=5.4.8 \
|
||||||
|
pycryptodome~=3.7.3 \
|
||||||
|
pylzma~=0.5.0 \
|
||||||
|
pyopenssl~=18.0.0 \
|
||||||
|
pyyaml~=3.13 \
|
||||||
|
requests~=2.21.0 \
|
||||||
|
send2trash~=1.5.0 \
|
||||||
|
service_identity~=18.1.0 \
|
||||||
|
twisted~=18.9.0 && \
|
||||||
|
rm -r ~/.cache && \
|
||||||
|
apk del build-base jpeg-dev libffi-dev linux-headers openssl-dev
|
||||||
|
|
||||||
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint
|
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint
|
||||||
RUN chmod +x /usr/local/bin/docker-entrypoint
|
RUN chmod +x /usr/local/bin/docker-entrypoint
|
||||||
|
|
40
README.md
40
README.md
|
@ -1,23 +1,23 @@
|
||||||
# hydrus-server-docker [![hydrus server version][hydrus-server-badge]][hydrus-server-version] [![Build status][travis-badge]][travis] [![Docker Hub build][docker-hub-badge]][docker-hub]
|
# hydrus-server-docker [![hydrus server version][hydrus-server-badge]][hydrus-server-version] [![Build status][travis-badge]][travis] [![Docker Hub build][docker-hub-badge]][docker-hub]
|
||||||
|
|
||||||
> Compiled version of [hydrus server][hydrus-server] running on Debian
|
> [hydrus server][hydrus-server] running on Alpine
|
||||||
|
|
||||||
This is a simple Debian-based Docker setup for running the compiled version of
|
This is a simple Alpine-based Docker setup for running
|
||||||
[hydrus server][hydrus-server]. It was mainly created for making it easier to
|
[hydrus server][hydrus-server] from source. It was mainly created for making it
|
||||||
run hydrus server together with [hydrusrv][hydrusrv], but can of course also be
|
easier to run hydrus server together with [hydrusrv][hydrusrv], but can of
|
||||||
used on its own.
|
course also be used on its own.
|
||||||
|
|
||||||
The latest build runs [hydrus server version 334][hydrus-server-version].
|
The latest build runs [hydrus server version 336][hydrus-server-version].
|
||||||
|
|
||||||
## Table of contents
|
## Table of contents
|
||||||
|
|
||||||
+ [Install](#install)
|
+ [Install](#install)
|
||||||
+ [Dependencies](#dependencies)
|
+ [Dependencies](#dependencies)
|
||||||
+ [Updating](#updating)
|
+ [Updating](#updating)
|
||||||
|
+ [Upgrading from 1.x to 2.x](#upgrading-from-1x-to-2x)
|
||||||
+ [Usage](#usage)
|
+ [Usage](#usage)
|
||||||
+ [Additional configuration when building](#additional-configuration-when-building)
|
+ [Additional configuration when building](#additional-configuration-when-building)
|
||||||
+ [UID/GID](#uidgid)
|
+ [UID/GID](#uidgid)
|
||||||
+ [Caveats](#caveats)
|
|
||||||
+ [Donate](#donate)
|
+ [Donate](#donate)
|
||||||
+ [Maintainer](#maintainer)
|
+ [Maintainer](#maintainer)
|
||||||
+ [Contribute](#contribute)
|
+ [Contribute](#contribute)
|
||||||
|
@ -35,7 +35,7 @@ By default, this will pull the latest build. To specify an image with a
|
||||||
specific version of hydrus server, provide the version number as tag, e.g.:
|
specific version of hydrus server, provide the version number as tag, e.g.:
|
||||||
|
|
||||||
```zsh
|
```zsh
|
||||||
user@local:~$ docker pull mserajnik/hydrus-server-docker:334
|
user@local:~$ docker pull mserajnik/hydrus-server-docker:336
|
||||||
```
|
```
|
||||||
|
|
||||||
See [here][docker-hub-tags] for all the available version numbers/tags.
|
See [here][docker-hub-tags] for all the available version numbers/tags.
|
||||||
|
@ -55,7 +55,7 @@ user@local:hydrus-server-docker$ docker build . -t hydrus-server-docker
|
||||||
### Updating
|
### Updating
|
||||||
|
|
||||||
If you have installed via Docker Hub, just pull the updated image. Otherwise,
|
If you have installed via Docker Hub, just pull the updated image. Otherwise,
|
||||||
just pull from this repository and make a new build.
|
pull from this repository and make a new build.
|
||||||
|
|
||||||
This repository follows [semantic versioning][semantic-versioning] and any
|
This repository follows [semantic versioning][semantic-versioning] and any
|
||||||
breaking changes that require additional attention will be released under a new
|
breaking changes that require additional attention will be released under a new
|
||||||
|
@ -65,6 +65,19 @@ are therefore always safe to simply install via the routine mentioned before.
|
||||||
When necessary, this section will be expanded with upgrade guides to new major
|
When necessary, this section will be expanded with upgrade guides to new major
|
||||||
versions.
|
versions.
|
||||||
|
|
||||||
|
#### Upgrading from 1.x to 2.x
|
||||||
|
|
||||||
|
Upgrading from `1.x` to `2.x` can be done via pulling the updated image from
|
||||||
|
Docker Hub or building it yourself and requires no further manual changes.
|
||||||
|
|
||||||
|
Since there have been issues with running the pre-compiled version of hydrus
|
||||||
|
server 335+ (which made the switch to Python 3) on the previous Docker setup,
|
||||||
|
starting with `2.0.0`, the Docker image is now based on Alpine (instead of
|
||||||
|
Debian) and runs hydrus server from source.
|
||||||
|
|
||||||
|
This approximately halves the resulting image size while at the same time
|
||||||
|
making it easier to adapt for future changes/dependencies.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
First, you need to bind the exposed ports. This can be done automatically
|
First, you need to bind the exposed ports. This can be done automatically
|
||||||
|
@ -112,11 +125,6 @@ with different ID's without hassle. In such a case, `HOST_USER_ID` and
|
||||||
`HOST_GROUP_ID` should match the user that is going to access the data on the
|
`HOST_GROUP_ID` should match the user that is going to access the data on the
|
||||||
host.
|
host.
|
||||||
|
|
||||||
## Caveats
|
|
||||||
|
|
||||||
+ The image also includes the hydrus client due to the compiled releases always
|
|
||||||
including both it and the server. This adds quite a bit of size to the image.
|
|
||||||
|
|
||||||
## Donate
|
## Donate
|
||||||
|
|
||||||
If you like hydrus-server-docker and want to buy me a coffee, feel free to
|
If you like hydrus-server-docker and want to buy me a coffee, feel free to
|
||||||
|
@ -147,13 +155,13 @@ You are welcome to help out!
|
||||||
|
|
||||||
[hydrus-server]: http://hydrusnetwork.github.io/hydrus/
|
[hydrus-server]: http://hydrusnetwork.github.io/hydrus/
|
||||||
[hydrusrv]: https://github.com/mserajnik/hydrusrv
|
[hydrusrv]: https://github.com/mserajnik/hydrusrv
|
||||||
[hydrus-server-version]: https://github.com/hydrusnetwork/hydrus/releases/tag/v334
|
[hydrus-server-version]: https://github.com/hydrusnetwork/hydrus/releases/tag/v336
|
||||||
[docker-hub]: https://hub.docker.com/r/mserajnik/hydrus-server-docker/
|
[docker-hub]: https://hub.docker.com/r/mserajnik/hydrus-server-docker/
|
||||||
[docker-hub-tags]: https://hub.docker.com/r/mserajnik/hydrus-server-docker/tags/
|
[docker-hub-tags]: https://hub.docker.com/r/mserajnik/hydrus-server-docker/tags/
|
||||||
[docker]: https://www.docker.com/
|
[docker]: https://www.docker.com/
|
||||||
[semantic-versioning]: https://semver.org/
|
[semantic-versioning]: https://semver.org/
|
||||||
|
|
||||||
[hydrus-server-badge]: https://img.shields.io/badge/hydrus%20server-version%20334-blue.svg
|
[hydrus-server-badge]: https://img.shields.io/badge/hydrus%20server-version%20336-blue.svg
|
||||||
|
|
||||||
[travis]: https://travis-ci.com/mserajnik/hydrus-server-docker
|
[travis]: https://travis-ci.com/mserajnik/hydrus-server-docker
|
||||||
[travis-badge]: https://travis-ci.com/mserajnik/hydrus-server-docker.svg
|
[travis-badge]: https://travis-ci.com/mserajnik/hydrus-server-docker.svg
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
|
source venv/bin/activate
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
./server stop -d="/data"
|
./server.py stop -d="/data"
|
||||||
}
|
}
|
||||||
|
|
||||||
trap "stop" SIGTERM
|
trap "stop" SIGTERM
|
||||||
|
|
||||||
./server -d="/data" &
|
./server.py -d="/data" &
|
||||||
|
|
||||||
wait $!
|
wait $!
|
||||||
|
|
Loading…
Reference in a new issue