wxbox-web dockerfile

This commit is contained in:
core 2024-10-28 12:44:18 -04:00
parent 7bf4c5eb22
commit e15acefa29
Signed by: core
GPG Key ID: 9D0DAED5555DD0B4
2 changed files with 39 additions and 0 deletions

16
wxbox-web/.dockerignore Normal file
View File

@ -0,0 +1,16 @@
node_modules
Dockerfile*
docker-compose*
.dockerignore
.git
.gitignore
README.md
LICENSE
.vscode
Makefile
helm-charts
.env
.editorconfig
.idea
cogerage*
target*

23
wxbox-web/Dockerfile Normal file
View File

@ -0,0 +1,23 @@
FROM oven/bun:1 AS base
WORKDIR /usr/src/app
FROM base AS install
RUN mkdir -p /tmp/dev
COPY package.json bun.lockb /tmp/dev
RUN cd /tmp/dev && bun install --frozen-lockfile
RUN mkdir -p /tmp/prod
COPY package.json bun.lockb /tmp/prod
RUN cd /tmp/prod && bun install --frozen-lockfile --production
FROM base AS release
COPY --from=install /tmp/dev/node_modules node_modules
COPY . .
ENV NODE_ENV=production
RUN bun test
RUN bun run build
USER bun
EXPOSE 3000/tcp
ENTRYPOINT [ "bun", "--bun", "run", "./build" ]