Ocelot-Social/backend/Dockerfile
Robert Schäfer 1ffa3cd046 Fix #799
For target `production` the badges were simply not copied. It also
explains why we never saw that error in development. For development we
use docker build target `build-and-test`.

FYI: @ulfgebhardt @Tirokk @ogerly
2019-06-12 23:55:42 +02:00

29 lines
813 B
Docker

FROM node:12.4-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
COPY ./public/img/ ./public/img/
RUN yarn install --frozen-lockfile --non-interactive