From f0c39f5837253b170237f554cef1276833ca4723 Mon Sep 17 00:00:00 2001 From: rhpidfyre Date: Thu, 12 Dec 2024 18:38:09 -0500 Subject: [PATCH] web: remove all unnecessary junk from the container after building (experiment & saves ~2GBs) --- web/.dockerignore | 3 ++- web/Containerfile | 8 ++++++++ web/next.config.ts | 1 - 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/web/.dockerignore b/web/.dockerignore index 5f255af..c6651e7 100644 --- a/web/.dockerignore +++ b/web/.dockerignore @@ -1,3 +1,4 @@ node_modules build -bun.lockb \ No newline at end of file +bun.lockb +.gitignore \ No newline at end of file diff --git a/web/Containerfile b/web/Containerfile index 4bc5f08..a048078 100644 --- a/web/Containerfile +++ b/web/Containerfile @@ -10,4 +10,12 @@ ENV NEXT_TELEMETRY_DISABLED=1 RUN bun install RUN bun run build + +RUN rm -rf src eslint.config.mjs tsconfig.json + +RUN bun remove "@emotion/react" "@emotion/styled" "@mui/icons-material" "@mui/material" "react" "react-dom" "sass" +# bun prune --production +# Uh-oh. bun prune is a subcommand reserved for future use by Bun. +RUN bun remove "typescript" "@types/node" "@types/react" "@types/react-dom" "eslint" "eslint-config-next" "@eslint/eslintrc" + ENTRYPOINT ["bun", "run", "start"] \ No newline at end of file diff --git a/web/next.config.ts b/web/next.config.ts index 8cb3c98..a6ad2a0 100644 --- a/web/next.config.ts +++ b/web/next.config.ts @@ -2,7 +2,6 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { distDir: "build", - output: "standalone", rewrites: async () => { return [ {