From 5ace7cdba71456f41c3adea1b97631ecb0784f60 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 22 Jan 2025 14:49:24 +0100 Subject: [PATCH] Create Dockerfile --- bun/Dockerfile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 bun/Dockerfile diff --git a/bun/Dockerfile b/bun/Dockerfile new file mode 100644 index 0000000..c5f1eb1 --- /dev/null +++ b/bun/Dockerfile @@ -0,0 +1,27 @@ +FROM oven/bun:1.1.45-alpine AS base +RUN apk add --no-cache git +# WORKDIR /app + +COPY package.json bun.lockb ./ +# Make sure these files are present before installing +RUN bun install --frozen-lockfile + +# Now copy the rest of your source code +COPY . . + +FROM base AS build + +# Declare the build argument +ARG SOURCE_COMMIT +# Set the environment variable using the build argument +ENV SOURCE_COMMIT=${SOURCE_COMMIT} + +ENV NODE_ENV=production + +# Run build script +RUN bun run build + +FROM build AS release +USER bun +EXPOSE 3000/tcp +ENTRYPOINT [ "bun", "run", "index.ts" ]