-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (28 loc) · 1.01 KB
/
Dockerfile
File metadata and controls
40 lines (28 loc) · 1.01 KB
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
FROM node:12-alpine as build
ENV YARN_VERSION=1.19.1
RUN apk update \
&& apk add tzdata curl bash binutils tar \
&& rm -rf /var/cache/apk/* \
&& /bin/bash \
&& curl https://yarnpkg.com/install.sh --output install.sh \
&& bash ./install.sh --version ${YARN_VERSION}
FROM node:12-alpine
RUN apk update \
&& apk add \
tzdata \
git \
&& cp /usr/share/zoneinfo/America/New_York /etc/localtime
# flow-bin is broken by default with alpine
# https://github.com/sgerrand/alpine-pkg-glibc
RUN apk --no-cache add ca-certificates wget && \
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.30-r0/glibc-2.30-r0.apk && \
apk add glibc-2.30-r0.apk
COPY --from=build /root/.yarn /home/node/.yarn
RUN chown -R node:node /home/node/.yarn
RUN mkdir -p /home/node/app
RUN chown -R node:node /home/node/app
USER node:node
ENV PATH="/home/node/.yarn/bin:${PATH}"
CMD yarn
WORKDIR /home/node/app