diff --git a/server/Dockerfile b/server/Dockerfile index 3d1c7f88..b0a6d3cf 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:latest +FROM alpine:3.12 WORKDIR /opt/app RUN \ @@ -7,6 +7,7 @@ RUN \ dumb-init \ ffmpeg \ py3-waitress \ + py3-pip \ # from requirements.txt: py3-yaml \ py3-psycopg2 \ @@ -22,7 +23,7 @@ RUN \ alembic \ "coloredlogs==5.0" \ youtube-dl \ - && exit 0 + && apk --no-cache del py3-pip ARG PUID=1000 ARG PGID=1000 diff --git a/server/hooks/test b/server/hooks/test index 9cbb16b9..056ca2c9 100755 --- a/server/hooks/test +++ b/server/hooks/test @@ -11,6 +11,7 @@ FROM ${BASE_IMAGE} WORKDIR /opt/app USER root RUN apk --no-cache add \ + py3-pip \ py3-pytest \ py3-pytest-cov \ postgresql \ diff --git a/server/requirements.txt b/server/requirements.txt index 810452e0..d80ec060 100644 --- a/server/requirements.txt +++ b/server/requirements.txt @@ -9,3 +9,4 @@ pillow>=4.3.0 pynacl>=1.2.1 pytz>=2018.3 pyRFC3339>=1.0 +youtube-dl diff --git a/server/szurubooru/tests/func/test_image_hash.py b/server/szurubooru/tests/func/test_image_hash.py index 10252915..13bfae83 100644 --- a/server/szurubooru/tests/func/test_image_hash.py +++ b/server/szurubooru/tests/func/test_image_hash.py @@ -15,7 +15,7 @@ def test_signature_functions(read_asset, config_injector): assert array_equal(sig2, sig2_repacked) dist1 = image_hash.normalized_distance([sig1], sig2) - assert abs(dist1[0] - 0.20599895341812172) < 1e-8 + assert abs(dist1[0] - 0.19713075553164386) < 1e-8 dist2 = image_hash.normalized_distance([sig2], sig2) assert abs(dist2[0]) < 1e-8 @@ -23,4 +23,4 @@ def test_signature_functions(read_asset, config_injector): words1 = image_hash.generate_words(sig1) words2 = image_hash.generate_words(sig2) words_match = sum(word1 == word2 for word1, word2 in zip(words1, words2)) - assert words_match == 17 + assert words_match == 18 diff --git a/server/szurubooru/tests/func/test_posts.py b/server/szurubooru/tests/func/test_posts.py index 097136c2..49f93be4 100644 --- a/server/szurubooru/tests/func/test_posts.py +++ b/server/szurubooru/tests/func/test_posts.py @@ -991,7 +991,7 @@ def test_search_by_image(post_factory, config_injector, read_asset): result1 = posts.search_by_image(read_asset('jpeg-similar.jpg')) assert len(result1) == 1 result1_distance, result1_post = result1[0] - assert abs(result1_distance - 0.20599895341812172) < 1e-8 + assert abs(result1_distance - 0.19713075553164386) < 1e-8 assert result1_post.post_id == post.post_id result2 = posts.search_by_image(read_asset('png.png'))