diff --git a/.woodpecker/build.yml b/.woodpecker/build.yml new file mode 100644 index 0000000..d1490d3 --- /dev/null +++ b/.woodpecker/build.yml @@ -0,0 +1,11 @@ +steps: + - name: Build and Push Image + when: + - event: push + branch: main + image: woodpeckerci/plugin-docker-buildx + settings: + repo: registry.lio.systems/wrath + registry: registry.lio.systems + dockerfile: Dockerfile + tag: dev \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bed9dca --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM oven/bun:latest as base +WORKDIR /usr/src/app + + +FROM base AS install +RUN mkdir -p /temp/dev +COPY package.json bun.lock /temp/dev/ +RUN cd /temp/dev && bun install --frozen-lockfile + +RUN mkdir -p /temp/prod +COPY package.json bun.lock /temp/prod/ +RUN cd /temp/prod && bun install --frozen-lockfile --production + + +FROM base AS build +COPY --from=install /temp/dev/node_modules node_modules +COPY . . +RUN bun run build + +FROM base AS release +COPY --from=install /temp/prod/node_modules node_modules +COPY --from=build /usr/src/app/dist . + +ENTRYPOINT [ "bun", "run", "./server/entry.mjs" ]