web: use multi-stage building for the container file
This commit is contained in:
parent
f0c39f5837
commit
49da5f6eb1
@ -1,4 +1,15 @@
|
||||
node_modules
|
||||
build
|
||||
bun.lockb
|
||||
Dockerfile*
|
||||
docker-compose*
|
||||
.dockerignore
|
||||
.git
|
||||
.gitignore
|
||||
README.md
|
||||
LICENSE
|
||||
.vscode
|
||||
Makefile
|
||||
helm-charts
|
||||
.env
|
||||
.editorconfig
|
||||
.idea
|
||||
coverage*
|
@ -1,21 +1,19 @@
|
||||
FROM oven/bun:latest
|
||||
FROM oven/bun AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY . .
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
RUN bun install && bun run build
|
||||
|
||||
RUN bun install
|
||||
RUN bun run build
|
||||
FROM build AS release
|
||||
|
||||
RUN rm -rf src eslint.config.mjs tsconfig.json
|
||||
WORKDIR /app
|
||||
|
||||
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"
|
||||
COPY --from=build /app/build ./.next
|
||||
RUN bun add next
|
||||
|
||||
ENTRYPOINT ["bun", "run", "start"]
|
||||
EXPOSE 3000
|
||||
ENTRYPOINT ["bun", "run", "env", "--", "next", "start", "-p", "3000"]
|
Loading…
Reference in New Issue
Block a user