From c41d32d527c47ae9839019476a37d9e04bc5d226 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Wed, 20 Jan 2021 13:43:22 +0100 Subject: [PATCH] - fixed node_modules running out of sync since they are on a volume for development docker builds --- backend/Dockerfile | 6 ++++-- webapp/Dockerfile | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 9db05d1b3..fcb978810 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -52,7 +52,9 @@ FROM base as development # local filesystem which will need a rebuild anyway # Run command -CMD ["yarn", "run", "dev"] +# (for development we need to execute yarn install since the +# node_modules are on another volume and need updating) +CMD /bin/sh -c "yarn install && yarn run dev" ################################################################################## # BUILD (Does contain all files and is therefore bloated) ######################## @@ -81,4 +83,4 @@ COPY --from=build ${DOCKER_WORKDIR}/public/providers.json ./public/providers.jso RUN yarn install --production=true --frozen-lockfile --non-interactive --no-cache # Run command -CMD ["yarn", "run", "start"] \ No newline at end of file +CMD /bin/sh -c "yarn run start" \ No newline at end of file diff --git a/webapp/Dockerfile b/webapp/Dockerfile index c03e49315..84269c459 100644 --- a/webapp/Dockerfile +++ b/webapp/Dockerfile @@ -52,7 +52,9 @@ FROM base as development # local filesystem which will need a rebuild anyway # Run command -CMD ["yarn", "run", "dev"] +# (for development we need to execute yarn install since the +# node_modules are on another volume and need updating) +CMD /bin/sh -c "yarn install && yarn run dev" ################################################################################## # BUILD (Does contain all files and is therefore bloated) ######################## @@ -83,6 +85,6 @@ COPY --from=build ${DOCKER_WORKDIR}/locales ./locales RUN yarn install --production=true --frozen-lockfile --non-interactive --no-cache # Run command -CMD ["yarn", "run", "start"] +CMD /bin/sh -c "yarn run start"