From b1aa184effb942932621687badef21d423133334 Mon Sep 17 00:00:00 2001 From: Daniel Hiller <46579393+daniel-hiller@users.noreply.github.com> Date: Wed, 14 Feb 2024 03:15:34 +0100 Subject: [PATCH] fix: Container build windows --- Dockerfile | 9 +++++---- start.sh | 4 +--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index c1b26e23..31a53688 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN apk -U upgrade \ WORKDIR /app -COPY server/package.json server/package-lock.json . +COPY server/package.json server/package-lock.json ./ RUN npm install npm@latest --global \ && npm install pnpm --global \ @@ -17,7 +17,7 @@ FROM node:lts AS client WORKDIR /app -COPY client/package.json client/package-lock.json . +COPY client/package.json client/package-lock.json ./ RUN npm install npm@latest --global \ && npm install pnpm --global \ @@ -54,6 +54,7 @@ VOLUME /app/private/attachments EXPOSE 1337 HEALTHCHECK --interval=10s --timeout=2s --start-period=15s \ - CMD node ./healthcheck.js + CMD node ./healthcheck.js -CMD ["./start.sh"] + +CMD [ "bash", "start.sh" ] diff --git a/start.sh b/start.sh index 5e10d639..440950cc 100755 --- a/start.sh +++ b/start.sh @@ -1,4 +1,2 @@ #!/bin/bash -set -e -node db/init.js -exec node app.js --prod $@ +export NODE_ENV=production && set -e && node db/init.js && node app.js --prod