forked from vincekruger/tgs-to-gif
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (31 loc) · 909 Bytes
/
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
FROM rust:alpine
MAINTAINER Ed Asriyan <[email protected]>
# https://stackoverflow.com/a/30873179
# https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md#running-on-alpine
# Installs latest Chromium package.
RUN apk update && apk add --no-cache \
chromium \
nss \
freetype \
freetype-dev \
harfbuzz \
ca-certificates \
ttf-freefont \
nodejs \
yarn \
gcc musl-dev nodejs
RUN apk add nodejs; if ! type "npm" > /dev/null; then apk add npm; fi
RUN cargo install gifski
# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
WORKDIR /app
# install dependencies
ADD package.json .
ADD package-lock.json .
RUN npm ci
# build the app
ADD cli.js .
ADD index.js .
ENV USE_SANDBOX false
ENV CHROMIUM_PATH /usr/bin/chromium-browser
CMD node cli.js /source