Ocelot-Social/Dockerfile
Robert Schäfer 4e816d9020 Fix (?) the build with an image tag for builder
Also I added a base stage so we can have a common working directory.
2018-12-14 23:10:48 +01:00

24 lines
723 B
Docker

FROM node:10-alpine as base
LABEL Description="Backend of the Social Network Human-Connection.org" Vendor="Human Connection gGmbH" Version="0.0.1" Maintainer="Human Connection gGmbH (developer@human-connection.org)"
EXPOSE 4000
ARG BUILD_COMMIT
ENV BUILD_COMMIT=$BUILD_COMMIT
ARG WORKDIR=/nitro-backend
RUN mkdir -p $WORKDIR
WORKDIR $WORKDIR
COPY package.json yarn.lock ./
COPY .env.template .env
CMD ["yarn", "run", "start"]
FROM base as builder
RUN yarn install --frozen-lockfile --non-interactive
COPY . .
RUN yarn run build
# reduce image size with a multistage build
FROM base as production
ENV NODE_ENV=production
COPY --from=builder /nitro-backend/dist ./dist
RUN yarn install --frozen-lockfile --non-interactive