forked from stelace/stelace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.prod
39 lines (31 loc) · 1.13 KB
/
Dockerfile.prod
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
# syntax = docker/dockerfile:1.0.2-experimental
# Using BuildKit for SSH, please refer to
# https://docs.docker.com/develop/develop-images/build_enhancements/#using-ssh-to-access-private-data-in-builds
FROM node:12.14-alpine
# Puppeteer installation process inspired by:
# https://github.com/GoogleChrome/puppeteer/issues/1793#issuecomment-442730223
ENV CHROME_BIN="/usr/bin/chromium-browser"
RUN apk --no-cache add \
python \
make \
g++ \
git \
# needed for SSH using Docker BuildKit
openssh-client \
# Puppeteer/chromium
udev \
ttf-freefont \
chromium
# Preparing to install private plugins from Github with SSH
RUN mkdir -p -m 0600 ~/.ssh && \
ssh-keyscan github.com >> ~/.ssh/known_hosts
COPY package.json yarn.lock /tmp/
# Install app dependencies in dedicated steps to leverage layer caching
# SSH potentially needed for private plugins
RUN --mount=type=ssh cd /tmp && yarn
RUN mkdir -p /usr/src/app && cd /usr/src/app && ln -s /tmp/node_modules
# Copy app directory
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN --mount=type=secret,id=env,dst=/usr/src/app/.env yarn plugins:prepare
CMD [ "node", "server/start.js" ]