From 15f9d595960a3397ff71c82d6bd2a40e4e9c3b5c Mon Sep 17 00:00:00 2001 From: einhorn_b Date: Tue, 13 Jun 2023 16:39:15 +0200 Subject: [PATCH] try another config for include prebuild @iota/client --- backend/Dockerfile | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 8b3a52463..9d5d53c43 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,7 +1,10 @@ ################################################################################## # BASE ########################################################################### ################################################################################## -FROM node:18.7.0-alpine3.16 as base +# base on custom docker container which is essential node:18.7.0-alpine3.16 +# but with installed build-tools for rust native npm modules +# and with compiled @iota/client +FROM gradido/iota_alpine:2.2.4 as base # ENVs (available in production aswell, can be overwritten by commandline or env file) ## DOCKER_WORKDIR would be a classical ARG, but that is not multi layer persistent - shame @@ -44,18 +47,10 @@ WORKDIR ${DOCKER_WORKDIR} RUN mkdir -p /database -################################################################################## -# BASE with build tools for rust based npm modules like @iota/client ############# -################################################################################## -FROM base as base_extended - -# needed for building @iota/client, it is a rust based module -RUN apk add --no-cache rust cargo python3 make g++ - ################################################################################## # DEVELOPMENT (Connected to the local environment, to reload on demand) ########## ################################################################################## -FROM base_extended as development +FROM base as development # We don't need to copy or build anything since we gonna bind to the # local filesystem which will need a rebuild anyway @@ -68,13 +63,17 @@ CMD /bin/sh -c "cd /database && yarn install && yarn build && cd /app && yarn in ################################################################################## # BUILD (Does contain all files and is therefore bloated) ######################## ################################################################################## -FROM base_extended as build +FROM base as build # Copy everything from backend COPY ./backend/ ./ # Copy everything from database COPY ./database/ ../database/ +# Copy prebuild @iota/client +RUN cp -r /prebuild_node_modules ${WORKDIR}/node_modules +#COPY --from=gradido/iota_alpine:2.2.4 /node_modules ${WORKDIR}/node_modules + # yarn install backend RUN yarn install --production=false --frozen-lockfile --non-interactive