From ebbd71a7ce16b636b588610539a814dc8c07d521 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Sun, 26 Oct 2025 16:19:36 +0800 Subject: [PATCH] [+] Docker --- Dockerfile | 34 ++++++++++++++++++++++++++++++++++ docker-compose.yml | 10 ++++++++++ 2 files changed, 44 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..585d7a3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +# ================================================ +FROM oven/bun AS build + +WORKDIR /app + +# Cache packages installation +COPY package.json package.json +COPY bun.lock bun.lock + +RUN bun install + +COPY ./src ./src + +ENV NODE_ENV=production + +RUN bun build \ + --compile \ + --minify-whitespace \ + --minify-syntax \ + --outfile server \ + src/index.ts + +# ================================================ +FROM gcr.io/distroless/base + +WORKDIR /app + +COPY --from=build /app/server server + +ENV NODE_ENV=production + +CMD ["./server"] + +EXPOSE 3000 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9193a26 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +services: + server: + build: + context: . + dockerfile: Dockerfile + ports: + - "3000:3000" + volumes: + - ./data:/app/data + command: /app/server