forked from xemle/home-gallery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
49 lines (37 loc) · 1.39 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Image builder
FROM node:18-alpine AS builder
ARG TARGETPLATFORM
ARG NO_SHARP
COPY .npmrc package.json pnpm-workspace.yaml *.js *.md *.yml LICENSE /build/
COPY e2e /build/e2e/
COPY packages /build/packages/
COPY scripts /build/scripts/
WORKDIR /build
RUN node scripts/disable-dependency.js api-server styleguide && \
if [[ -n "$NO_SHARP" || "$TARGETPLATFORM" == "linux/arm/v6" || "$TARGETPLATFORM" == "linux/arm/v7" ]]; then node scripts/disable-dependency.js --prefix=packages/extractor sharp ; fi && \
npm install
RUN npm run build --loglevel verbose
RUN node scripts/bundle.js --bundle-file=bundle-docker.yml && \
mkdir -p app && tar -xvf dist/latest/home-gallery-*.tar.gz -C app
# Final image
FROM node:18-alpine
LABEL org.opencontainers.image.authors="[email protected]"
LABEL org.opencontainers.image.url="https://home-gallery.org"
LABEL org.opencontainers.image.documentation="https://docs.home-gallery.org"
LABEL org.opencontainers.image.source="https://github.com/xemle/home-gallery"
RUN apk add --no-cache \
ffmpeg \
vips-tools \
perl
COPY --from=builder /build/app /app
VOLUME [ "/data" ]
WORKDIR /data
ENV HOME=/data
ENV GALLERY_BASE_DIR=/data
ENV GALLERY_CONFIG_DIR=/data/config
ENV GALLERY_CACHE_DIR=/data
ENV GALLERY_CONFIG=/data/config/gallery.config.yml
ENV GALLERY_OPEN_BROWSER=false
ENV GALLERY_USE_NATIVE=ffprobe,ffmpeg
EXPOSE 3000
ENTRYPOINT [ "node", "/app/gallery.js" ]