From e15acefa29c614bbe80e2c77ea5aa39cd3c8e34c Mon Sep 17 00:00:00 2001 From: core Date: Mon, 28 Oct 2024 12:44:18 -0400 Subject: [PATCH] wxbox-web dockerfile --- wxbox-web/.dockerignore | 16 ++++++++++++++++ wxbox-web/Dockerfile | 23 +++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 wxbox-web/.dockerignore create mode 100644 wxbox-web/Dockerfile diff --git a/wxbox-web/.dockerignore b/wxbox-web/.dockerignore new file mode 100644 index 0000000..835654a --- /dev/null +++ b/wxbox-web/.dockerignore @@ -0,0 +1,16 @@ +node_modules +Dockerfile* +docker-compose* +.dockerignore +.git +.gitignore +README.md +LICENSE +.vscode +Makefile +helm-charts +.env +.editorconfig +.idea +cogerage* +target* diff --git a/wxbox-web/Dockerfile b/wxbox-web/Dockerfile new file mode 100644 index 0000000..49312f3 --- /dev/null +++ b/wxbox-web/Dockerfile @@ -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" ]