Browse Source

Use multistage Dockerfile to cut down image size (#140)

pull/143/head
Oleg Kurapov 6 years ago
committed by Cian Butler
parent
commit
07d87bdb04
  1. 11
      Dockerfile

11
Dockerfile

@ -1,10 +1,15 @@
FROM node:8-alpine as builder
WORKDIR /usr/src/app
RUN apk add --update build-base python
COPY . /usr/src/app
RUN yarn
FROM node:8-alpine
MAINTAINER butlerx@notthe.cloud
WORKDIR /app
RUN adduser -D -h /home/term -s /bin/sh term && \
( echo "term:term" | chpasswd ) && \
apk add --update build-base python openssh-client
apk add openssh-client
EXPOSE 3000
COPY . /app
RUN yarn
COPY --from=builder /usr/src/app /app
CMD node bin

Loading…
Cancel
Save