From 50d463ac3b9807c2a0d45255673864072b03f9d1 Mon Sep 17 00:00:00 2001 From: Dennis Heinrich Date: Tue, 26 Nov 2024 10:07:23 +0100 Subject: [PATCH] Storage size of docker image minimized --- Dockerfile | 8 ++++++-- package.json | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 745d503..8f7273b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,10 @@ LABEL authors="Dennis Heinrich" WORKDIR /app COPY . /app RUN npm install +RUN npm run build -CMD ["npm", "start"] -ENTRYPOINT ["npm", "start"] \ No newline at end of file +## Simplyfy the rm commands +RUN rm -rf .ddev/ source/ misc/ .git .gitignore config.example.json Dockerfile docker-compose.yml README.md + +CMD ["npm", "run", "start-only"] +ENTRYPOINT ["npm", "run", "start-only"] \ No newline at end of file diff --git a/package.json b/package.json index 6395f74..9857359 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "source/Main.ts", "scripts": { "start": "npx tsc && node build/Main.js", + "start-only": "node build/Main.js", "build": "npx tsc", "schema": "npx json2ts -i source/Schema/ServerStats.json -o ./source/Schema/ServerStats.d.ts --unreachableDefinitions", "test": "echo \"Error: no test specified\" && exit 1"