From 82f53483b2161efa1385386a947c429ea139914b Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 19 May 2023 16:44:09 +0200 Subject: [PATCH] Fix server docker --- packages/server/.dockerignore | 3 ++- packages/server/Dockerfile | 3 +++ packages/server/src/environment.ts | 1 + packages/server/src/utilities/fileSystem/filesystem.ts | 4 +++- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/server/.dockerignore b/packages/server/.dockerignore index 3e7ee31bbd..214a2b2220 100644 --- a/packages/server/.dockerignore +++ b/packages/server/.dockerignore @@ -2,4 +2,5 @@ !/dist/ !/scripts/integrations/oracle/ !/package.json -!/docker_run.sh \ No newline at end of file +!/docker_run.sh +!/builder/ \ No newline at end of file diff --git a/packages/server/Dockerfile b/packages/server/Dockerfile index f3ca43777b..75f3a41769 100644 --- a/packages/server/Dockerfile +++ b/packages/server/Dockerfile @@ -34,6 +34,7 @@ RUN apt-get remove -y --purge --auto-remove g++ make python \ COPY dist/ . COPY docker_run.sh . +COPY builder/ builder/ EXPOSE 4001 @@ -42,4 +43,6 @@ EXPOSE 4001 # which are actually needed to get this environment up and running ENV NODE_ENV=production ENV CLUSTER_MODE=${CLUSTER_MODE} +ENV TOP_LEVEL_PATH=/app + CMD ["./docker_run.sh"] diff --git a/packages/server/src/environment.ts b/packages/server/src/environment.ts index 2265d7e75d..bed4c711f6 100644 --- a/packages/server/src/environment.ts +++ b/packages/server/src/environment.ts @@ -96,6 +96,7 @@ const environment = { isInThread: () => { return process.env.FORKED_PROCESS }, + TOP_LEVEL_PATH: process.env.TOP_LEVEL_PATH, } // threading can cause memory issues with node-ts in development diff --git a/packages/server/src/utilities/fileSystem/filesystem.ts b/packages/server/src/utilities/fileSystem/filesystem.ts index 6d3c6d48f6..1c6971b1e8 100644 --- a/packages/server/src/utilities/fileSystem/filesystem.ts +++ b/packages/server/src/utilities/fileSystem/filesystem.ts @@ -4,9 +4,11 @@ import { budibaseTempDir } from "../budibaseDir" import { join } from "path" import env from "../../environment" import tar from "tar" +import environment from "../../environment" const uuid = require("uuid/v4") -export const TOP_LEVEL_PATH = join(__dirname, "..", "..", "..") +export const TOP_LEVEL_PATH = + environment.TOP_LEVEL_PATH || join(__dirname, "..", "..", "..") /** * Upon first startup of instance there may not be everything we need in tmp directory, set it up.