Ocelot-Social/backend/Dockerfile
dependabot-preview[bot] bc173c0dc3
Bump node from 10-alpine to 12.3.1-alpine in /backend
Bumps node from 10-alpine to 12.3.1-alpine.
2019-05-31 05:01:59 +00:00

28 lines
782 B
Docker

FROM node:12.3.1-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
RUN apk --no-cache add git
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 cp .env.template .env
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