Made image resizing optional again to keep Docker image size down

This commit is contained in:
krateng 2021-12-31 21:27:22 +01:00
parent 3714aef878
commit 9ec52806c4
10 changed files with 11 additions and 10 deletions

View File

@ -24,7 +24,6 @@ RUN \
# expected behavior for a default setup is for maloja to "just work"
ENV MALOJA_SKIP_SETUP=yes
ENV MAGICK_HOME=/usr
EXPOSE 42010
# use exec form for better signal handling https://docs.docker.com/engine/reference/builder/#entrypoint

View File

@ -0,0 +1 @@
python3

View File

@ -1,6 +1,7 @@
gcc
libxml2-dev
libxslt-dev
py3-pip
libffi-dev
libc-dev
py3-pip
linux-headers

View File

@ -1,5 +1 @@
python3
python3-dev
imagemagick
imagemagick-dev
tzdata

View File

@ -0,0 +1 @@
vips

View File

@ -1,2 +1,4 @@
sed 's/#.*//' ./install/dependencies_run.txt | xargs apk add
sed 's/#.*//' ./install/dependencies_basic.txt | xargs apk add
sed 's/#.*//' ./install/dependencies_build.txt | xargs apk add
sed 's/#.*//' ./install/dependencies_run.txt | xargs apk add
sed 's/#.*//' ./install/dependencies_run_opt.txt | xargs apk add

View File

@ -6,7 +6,7 @@ from threading import Thread
import setproctitle
import pkg_resources
from css_html_js_minify import html_minify, css_minify
from pyvips import Image
# server stuff
from bottle import Bottle, static_file, request, response, FormsDict, redirect, BaseRequest, abort
@ -175,6 +175,7 @@ def static_image(pth):
response = static_file(small_pth,root=data_dir['images']())
else:
try:
from pyvips import Image
thumb = Image.thumbnail(data_dir['images'](pth),300)
thumb.webpsave(data_dir['images'](small_pth))
response = static_file(small_pth,root=data_dir['images']())

View File

@ -24,7 +24,7 @@ dependencies = [
"doreah>=1.7.2, <2",
"nimrodel>=0.7.0",
"setproctitle>=1.1.10",
"wand>=0.5.4",
#"pyvips>=2.1.16",
"jinja2>=2.11",
"lru-dict>=1.1.6",
"css_html_js_minify>=2.5.5",

View File

@ -3,7 +3,6 @@ waitress>=1.3
doreah>=1.7.2
nimrodel>=0.7.0
setproctitle>=1.1.10
wand>=0.5.4
jinja2>=2.11
lru-dict>=1.1.6
css_html_js_minify>=2.5.5

1
requirements_extra.txt Normal file
View File

@ -0,0 +1 @@
pyvips>=2.1