Thumbnail cache warm-up for demo

This commit is contained in:
Michael Mayer 2019-05-09 07:48:41 +02:00
parent 8d4291de38
commit a612609854
3 changed files with 15 additions and 10 deletions

View file

@ -1,12 +1,17 @@
FROM photoprism/photoprism:latest as build
RUN mkdir -p /srv/photoprism/photos/import && \
wget -qO- https://dl.photoprism.org/fixtures/demo.tar.gz | tar xvz -C /srv/photoprism/photos/import
RUN photoprism import
# Hide TensorFlow warnings
ENV TF_CPP_MIN_LOG_LEVEL 2
RUN mkdir -p /srv/photoprism/photos/import && \
wget -qO- https://dl.photoprism.org/fixtures/demo.tar.gz | tar xvz -C /srv/photoprism/photos/import
# Import example photos
RUN photoprism import
# Thumbnail cache warmup
RUN photoprism thumbnails -q -s 50 -s 100 -s 320 -s 500
RUN photoprism thumbnails -s 720 -s 1280 -s 1920 -s 2560 -s 3840
# Start PhotoPrism server
CMD photoprism start

View file

@ -12,6 +12,9 @@ FROM ubuntu:18.04
WORKDIR /srv/photoprism
# Hide TensorFlow warnings
ENV TF_CPP_MIN_LOG_LEVEL 2
# Install additional distribution packages
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
@ -45,9 +48,6 @@ RUN apt-get update && \
# Show photoprism version
RUN photoprism -v
# Hide TensorFlow warnings
ENV TF_CPP_MIN_LOG_LEVEL 2
# Expose HTTP & TiDB port
EXPOSE 80
EXPOSE 4000

View file

@ -18,7 +18,7 @@ var ThumbnailsCommand = cli.Command{
},
cli.BoolFlag{
Name: "default, d",
Usage: "Render default sizes: 320, 500, 640, 1280, 1920 and 2560px",
Usage: "Render default sizes: 720, 1280, 1920, 2560 and 3840px",
},
cli.BoolFlag{
Name: "square, q",
@ -40,7 +40,7 @@ func thumbnailsAction(ctx *cli.Context) error {
sizes := ctx.IntSlice("size")
if ctx.Bool("default") {
sizes = []int{320, 500, 640, 1280, 1920, 2560}
sizes = []int{720, 1280, 1920, 2560, 3840}
}
if len(sizes) == 0 {