web: use multi-stage building for the container file
This commit is contained in:
parent
f0c39f5837
commit
49da5f6eb1
@ -1,4 +1,15 @@
|
|||||||
node_modules
|
node_modules
|
||||||
build
|
Dockerfile*
|
||||||
bun.lockb
|
docker-compose*
|
||||||
|
.dockerignore
|
||||||
|
.git
|
||||||
.gitignore
|
.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
|
WORKDIR /app
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
EXPOSE 3000
|
ENV NODE_ENV=production
|
||||||
|
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
|
RUN bun install && bun run build
|
||||||
|
|
||||||
RUN bun install
|
FROM build AS release
|
||||||
RUN bun run build
|
|
||||||
|
|
||||||
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"
|
COPY --from=build /app/build ./.next
|
||||||
# bun prune --production
|
RUN bun add next
|
||||||
# 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"]
|
EXPOSE 3000
|
||||||
|
ENTRYPOINT ["bun", "run", "env", "--", "next", "start", "-p", "3000"]
|
Loading…
Reference in New Issue
Block a user