-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (31 loc) · 926 Bytes
/
Dockerfile
File metadata and controls
39 lines (31 loc) · 926 Bytes
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
FROM node:10.18.0-alpine3.11 as base
ARG USER=app
RUN set -ex; \
apk add --no-cache --virtual .dev-dep \
git \
openssh \
python \
make \
pkgconfig autoconf automake libtool nasm build-base zlib-dev \
g++;
RUN set -ex; \
apk add --no-cache nginx && \
ln -sf /dev/stdout /var/lib/nginx/logs/access.log && \
ln -sf /dev/stderr /var/lib/nginx/logs/error.log && \
mkdir -p /run/nginx && \
addgroup ${USER} && adduser -D -s /sbin/nologin -G ${USER} ${USER} && \
chown -R ${USER}:${USER} /var/lib/nginx /run/nginx
COPY .nginx /etc/nginx/conf.d/default.conf
FROM node:10-alpine as build
WORKDIR /app
COPY package.json package-lock.json /app/
RUN npm i
COPY . /app
RUN set -ex; npm run build:all
FROM base
ARG USER=app
WORKDIR /app
COPY --from=build /app/packages/york-styleguide/lib ./build
USER $USER
EXPOSE 3000
CMD ["nginx", "-g", "daemon off;"]