Thumbnail cache warm-up for demo
This commit is contained in:
parent
8d4291de38
commit
a612609854
|
@ -1,12 +1,17 @@
|
||||||
FROM photoprism/photoprism:latest as build
|
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
|
# Hide TensorFlow warnings
|
||||||
ENV TF_CPP_MIN_LOG_LEVEL 2
|
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
|
# Start PhotoPrism server
|
||||||
CMD photoprism start
|
CMD photoprism start
|
||||||
|
|
|
@ -12,6 +12,9 @@ FROM ubuntu:18.04
|
||||||
|
|
||||||
WORKDIR /srv/photoprism
|
WORKDIR /srv/photoprism
|
||||||
|
|
||||||
|
# Hide TensorFlow warnings
|
||||||
|
ENV TF_CPP_MIN_LOG_LEVEL 2
|
||||||
|
|
||||||
# Install additional distribution packages
|
# Install additional distribution packages
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
curl \
|
curl \
|
||||||
|
@ -45,9 +48,6 @@ RUN apt-get update && \
|
||||||
# Show photoprism version
|
# Show photoprism version
|
||||||
RUN photoprism -v
|
RUN photoprism -v
|
||||||
|
|
||||||
# Hide TensorFlow warnings
|
|
||||||
ENV TF_CPP_MIN_LOG_LEVEL 2
|
|
||||||
|
|
||||||
# Expose HTTP & TiDB port
|
# Expose HTTP & TiDB port
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
EXPOSE 4000
|
EXPOSE 4000
|
||||||
|
|
|
@ -18,7 +18,7 @@ var ThumbnailsCommand = cli.Command{
|
||||||
},
|
},
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
Name: "default, d",
|
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{
|
cli.BoolFlag{
|
||||||
Name: "square, q",
|
Name: "square, q",
|
||||||
|
@ -40,7 +40,7 @@ func thumbnailsAction(ctx *cli.Context) error {
|
||||||
sizes := ctx.IntSlice("size")
|
sizes := ctx.IntSlice("size")
|
||||||
|
|
||||||
if ctx.Bool("default") {
|
if ctx.Bool("default") {
|
||||||
sizes = []int{320, 500, 640, 1280, 1920, 2560}
|
sizes = []int{720, 1280, 1920, 2560, 3840}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(sizes) == 0 {
|
if len(sizes) == 0 {
|
||||||
|
|
Loading…
Reference in a new issue