2022-03-09 21:57:29 +03:00
|
|
|
# syntax=docker/dockerfile:1.3.0-labs
|
|
|
|
|
2024-07-08 12:31:18 +03:00
|
|
|
FROM node:20.15-alpine3.19 as builder
|
2015-11-13 06:53:55 +03:00
|
|
|
|
2017-08-25 13:41:05 +03:00
|
|
|
ENV NODE_ENV production
|
2018-01-03 13:22:46 +03:00
|
|
|
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
|
|
|
|
|
2015-11-14 00:08:41 +03:00
|
|
|
WORKDIR /decktape
|
2015-11-15 22:29:34 +03:00
|
|
|
|
2024-07-08 12:31:18 +03:00
|
|
|
COPY package.json package-lock.json ./
|
2015-11-22 21:02:45 +03:00
|
|
|
COPY libs libs/
|
|
|
|
COPY plugins plugins/
|
2015-11-23 00:50:47 +03:00
|
|
|
COPY decktape.js ./
|
2015-11-22 21:02:45 +03:00
|
|
|
|
2024-07-08 12:31:18 +03:00
|
|
|
RUN npm ci --omit=dev
|
2015-11-14 00:08:41 +03:00
|
|
|
|
2024-03-02 18:19:10 +03:00
|
|
|
FROM alpine:3.19.1
|
2017-09-04 13:13:53 +03:00
|
|
|
|
2021-12-03 20:44:43 +03:00
|
|
|
LABEL org.opencontainers.image.source="https://github.com/astefanutti/decktape"
|
|
|
|
|
2024-08-15 12:17:40 +03:00
|
|
|
ARG CHROMIUM_VERSION=127.0.6533.99-r0
|
2018-02-28 16:26:21 +03:00
|
|
|
ENV TERM xterm-color
|
|
|
|
|
2022-03-09 21:57:29 +03:00
|
|
|
RUN <<EOF cat > /etc/apk/repositories
|
2023-03-08 18:26:38 +03:00
|
|
|
http://dl-cdn.alpinelinux.org/alpine/edge/main
|
|
|
|
http://dl-cdn.alpinelinux.org/alpine/edge/community
|
2022-03-09 21:57:29 +03:00
|
|
|
http://dl-cdn.alpinelinux.org/alpine/edge/testing
|
|
|
|
EOF
|
|
|
|
|
2019-01-03 23:49:21 +03:00
|
|
|
# Chromium, CA certificates, fonts
|
2018-02-28 16:26:21 +03:00
|
|
|
# https://git.alpinelinux.org/cgit/aports/log/community/chromium
|
2019-01-03 23:49:21 +03:00
|
|
|
RUN apk update && apk upgrade && \
|
|
|
|
apk add --no-cache \
|
|
|
|
ca-certificates \
|
2022-03-09 21:57:29 +03:00
|
|
|
libstdc++ \
|
2022-06-24 11:41:08 +03:00
|
|
|
chromium=${CHROMIUM_VERSION} \
|
2022-03-09 21:57:29 +03:00
|
|
|
font-noto-emoji \
|
|
|
|
freetype \
|
|
|
|
harfbuzz \
|
|
|
|
nss \
|
|
|
|
ttf-freefont \
|
|
|
|
wqy-zenhei && \
|
2018-08-09 20:54:10 +03:00
|
|
|
# /etc/fonts/conf.d/44-wqy-zenhei.conf overrides 'monospace' matching FreeMono.ttf in /etc/fonts/conf.d/69-unifont.conf
|
|
|
|
mv /etc/fonts/conf.d/44-wqy-zenhei.conf /etc/fonts/conf.d/74-wqy-zenhei.conf && \
|
2018-02-28 16:26:21 +03:00
|
|
|
rm -rf /var/cache/apk/*
|
|
|
|
|
|
|
|
# Node.js
|
|
|
|
COPY --from=builder /usr/local/bin/node /usr/local/bin/
|
|
|
|
|
|
|
|
# DeckTape
|
|
|
|
COPY --from=builder /decktape /decktape
|
|
|
|
|
|
|
|
RUN addgroup -g 1000 node && \
|
|
|
|
adduser -u 1000 -G node -s /bin/sh -D node && \
|
|
|
|
mkdir /slides && \
|
|
|
|
chown node:node /slides
|
2017-08-25 13:41:05 +03:00
|
|
|
|
2016-08-23 16:30:02 +03:00
|
|
|
WORKDIR /slides
|
|
|
|
|
2018-02-28 16:26:21 +03:00
|
|
|
USER node
|
|
|
|
|
|
|
|
# The --no-sandbox option is required, or --cap-add=SYS_ADMIN to docker run command
|
|
|
|
# https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker
|
2017-08-25 13:41:05 +03:00
|
|
|
# https://github.com/GoogleChrome/puppeteer/issues/290
|
2018-02-28 16:26:21 +03:00
|
|
|
# https://github.com/jessfraz/dockerfiles/issues/65
|
|
|
|
# https://github.com/jessfraz/dockerfiles/issues/156
|
|
|
|
# https://github.com/jessfraz/dockerfiles/issues/341
|
2024-07-05 16:19:48 +03:00
|
|
|
ENTRYPOINT ["node", "/decktape/decktape.js", "--chrome-path", "/usr/bin/chromium-browser", "--chrome-arg=--no-sandbox"]
|
2017-08-25 13:41:05 +03:00
|
|
|
|
2015-11-22 21:06:53 +03:00
|
|
|
CMD ["-h"]
|