mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Fix (?) the build with an image tag for builder
Also I added a base stage so we can have a common working directory.
This commit is contained in:
parent
bef8aa1d6a
commit
4e816d9020
22
Dockerfile
22
Dockerfile
@ -1,29 +1,23 @@
|
||||
FROM node:10-alpine as builder
|
||||
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 the app port
|
||||
EXPOSE 4000
|
||||
|
||||
ARG BUILD_COMMIT
|
||||
ENV BUILD_COMMIT=$BUILD_COMMIT
|
||||
ARG WORKDIR=/nitro-backend
|
||||
RUN mkdir -p $WORKDIR
|
||||
WORKDIR $WORKDIR
|
||||
|
||||
# Install the Application Dependencies
|
||||
COPY package.json .
|
||||
COPY yarn.lock .
|
||||
RUN yarn install --frozen-lockfile --non-interactive
|
||||
|
||||
COPY . .
|
||||
COPY package.json yarn.lock ./
|
||||
COPY .env.template .env
|
||||
|
||||
RUN yarn run build
|
||||
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 node:10-alpine as production
|
||||
FROM base as production
|
||||
ENV NODE_ENV=production
|
||||
COPY --from=builder /nitro-backend/dist ./dist
|
||||
COPY package.json yarn.lock ./
|
||||
RUN yarn install --frozen-lockfile --non-interactive
|
||||
|
||||
@ -2,6 +2,7 @@ version: "3.7"
|
||||
|
||||
services:
|
||||
backend:
|
||||
image: humanconnection/nitro-backend:builder
|
||||
build:
|
||||
context: .
|
||||
target: builder
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user