web: remove all unnecessary junk from the container after building (experiment & saves ~2GBs)

This commit is contained in:
rhpidfyre 2024-12-12 18:38:09 -05:00
parent fdc1f1aadf
commit f0c39f5837
3 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,4 @@
node_modules
build
bun.lockb
bun.lockb
.gitignore

View File

@ -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"]

View File

@ -2,7 +2,6 @@ import type { NextConfig } from "next";
const nextConfig: NextConfig = {
distDir: "build",
output: "standalone",
rewrites: async () => {
return [
{