Ocelot-Social/backend/Dockerfile
mattwr18 66f1aa8888 Follow @roschaefer PR review suggestions
- Update seed file with more human readable imageAspectRatios
- Remove copy script from Dockerfile to not expose to others. we'll need
to either start a maintenance server, so it has access to both the
backend/public/uploads and cypher-shell, or copy a script to the backend
that creates a csv, which can be copied to the neo4j pod and then loaded
into the cypher.
- Remove unintended changes to deployment/legacy-migration
- Add back image compression to Post images
2019-12-03 15:33:54 +01:00

29 lines
925 B
Docker

FROM node:12.12.0-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
CMD ["yarn", "run", "start"]
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
FROM base as build-and-test
RUN yarn install --production=false --frozen-lockfile --non-interactive
COPY . .
RUN NODE_ENV=production yarn run build
# reduce image size with a multistage build
FROM base as production
ENV NODE_ENV=production
COPY --from=build-and-test /nitro-backend/dist ./dist
COPY ./public/img/ ./public/img/
COPY ./public/providers.json ./public/providers.json
RUN yarn install --production=true --frozen-lockfile --non-interactive --no-cache