From 1a91f6191c99443da9413e9b717661a1cf6d161c Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Sat, 9 Oct 2021 13:44:37 +0200 Subject: [PATCH] reshape build context to fix out of context error when copying database entities --- backend/Dockerfile | 4 ++-- docker-compose.yml | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 02f772db6..a8554fbb5 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -61,9 +61,9 @@ CMD /bin/sh -c "yarn install && yarn run dev" FROM base as build # Copy everything -COPY . . +COPY ./backend ./ # Also copy external enities from database -COPY ../database/entity/ ../database/entity/ +COPY ./database/entity/ ../database/entity/ # npm install RUN yarn install --production=false --frozen-lockfile --non-interactive # npm build diff --git a/docker-compose.yml b/docker-compose.yml index 15a47111c..b85d155fe 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -54,7 +54,10 @@ services: backend: image: gradido/backend:latest build: - context: ./backend + # since we have to include the entities from ./database we cannot define the context as ./backend + # this might blow build image size to the moon ?! + context: ./ + dockerfile: ./backend/Dockerfile target: production networks: - internal-net