-
Notifications
You must be signed in to change notification settings - Fork 176
/
Dockerfile
69 lines (52 loc) · 1.98 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# syntax=docker/dockerfile:1.3.0-labs
FROM node:20.15-alpine3.19 as builder
ENV NODE_ENV production
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
WORKDIR /decktape
COPY package.json package-lock.json ./
COPY libs libs/
COPY plugins plugins/
COPY decktape.js ./
RUN npm ci --omit=dev
FROM alpine:3.19.1
LABEL org.opencontainers.image.source="https://github.com/astefanutti/decktape"
ARG CHROMIUM_VERSION=127.0.6533.99-r0
ENV TERM xterm-color
RUN <<EOF cat > /etc/apk/repositories
http://dl-cdn.alpinelinux.org/alpine/latest-stable/main
http://dl-cdn.alpinelinux.org/alpine/latest-stable/community
EOF
# Chromium, CA certificates, fonts
# https://git.alpinelinux.org/cgit/aports/log/community/chromium
RUN apk update && apk upgrade && \
apk add --no-cache \
ca-certificates \
libstdc++ \
chromium=${CHROMIUM_VERSION} \
font-noto-emoji \
freetype \
harfbuzz \
nss \
ttf-freefont \
wqy-zenhei && \
# /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 && \
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
WORKDIR /slides
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
# https://github.com/GoogleChrome/puppeteer/issues/290
# https://github.com/jessfraz/dockerfiles/issues/65
# https://github.com/jessfraz/dockerfiles/issues/156
# https://github.com/jessfraz/dockerfiles/issues/341
ENTRYPOINT ["node", "/decktape/decktape.js", "--chrome-path", "/usr/bin/chromium-browser", "--chrome-arg=--no-sandbox", "--chrome-arg=--disable-gpu"]
CMD ["-h"]