2018-07-16 18:07:56 +03:00
|
|
|
FROM node:8-alpine AS builder
|
2018-06-13 23:36:41 +03:00
|
|
|
|
|
|
|
RUN npm install -g npm@6 && rm -rf ~app/.npm /tmp/*
|
2016-05-26 18:31:13 +03:00
|
|
|
|
2016-11-15 01:20:41 +03:00
|
|
|
RUN addgroup -g 10001 app && \
|
|
|
|
adduser -D -G app -h /app -u 10001 app
|
|
|
|
WORKDIR /app
|
2016-05-26 18:31:13 +03:00
|
|
|
|
2016-11-15 01:20:41 +03:00
|
|
|
# S3 bucket in Cloud Services prod IAM
|
|
|
|
ADD https://s3.amazonaws.com/dumb-init-dist/v1.2.0/dumb-init_1.2.0_amd64 /usr/local/bin/dumb-init
|
|
|
|
RUN chmod +x /usr/local/bin/dumb-init
|
|
|
|
ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]
|
2016-05-26 18:31:13 +03:00
|
|
|
|
2018-07-16 18:07:56 +03:00
|
|
|
RUN apk add --repository http://dl-cdn.alpinelinux.org/alpine/v3.5/community/ --no-cache graphicsmagick git && \
|
|
|
|
apk add --repository http://dl-cdn.alpinelinux.org/alpine/v3.5/community/ --no-cache --virtual .build-deps git python make g++
|
2016-05-26 18:31:13 +03:00
|
|
|
|
2016-11-15 01:20:41 +03:00
|
|
|
USER app
|
2016-05-26 19:35:56 +03:00
|
|
|
|
2017-01-13 23:36:49 +03:00
|
|
|
COPY npm-shrinkwrap.json npm-shrinkwrap.json
|
2016-05-26 18:31:13 +03:00
|
|
|
COPY package.json package.json
|
2017-01-13 23:36:49 +03:00
|
|
|
COPY scripts/check_gm.sh scripts/check_gm.sh
|
2016-05-26 18:31:13 +03:00
|
|
|
|
2016-11-15 01:20:41 +03:00
|
|
|
RUN npm install --production && rm -rf ~app/.npm /tmp/*
|
2016-05-26 18:31:13 +03:00
|
|
|
|
|
|
|
COPY . /app
|
2018-07-16 18:07:56 +03:00
|
|
|
|
|
|
|
|
|
|
|
# Build final image by copying from builder
|
|
|
|
FROM node:8-alpine
|
|
|
|
|
|
|
|
RUN npm install -g npm@6 && rm -rf ~app/.npm /tmp/*
|
|
|
|
|
|
|
|
RUN addgroup -g 10001 app && \
|
|
|
|
adduser -D -G app -h /app -u 10001 app
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
# S3 bucket in Cloud Services prod IAM
|
|
|
|
ADD https://s3.amazonaws.com/dumb-init-dist/v1.2.0/dumb-init_1.2.0_amd64 /usr/local/bin/dumb-init
|
|
|
|
RUN chmod +x /usr/local/bin/dumb-init
|
|
|
|
ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]
|
|
|
|
|
|
|
|
RUN apk add --repository http://dl-cdn.alpinelinux.org/alpine/v3.5/community/ --no-cache graphicsmagick git
|
|
|
|
|
|
|
|
USER app
|
|
|
|
|
|
|
|
COPY --from=builder --chown=app /app/ /app/
|