[+] Docker

This commit is contained in:
2025-10-26 16:19:36 +08:00
parent f272cdb0ae
commit ebbd71a7ce
2 changed files with 44 additions and 0 deletions
+34
View File
@@ -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
+10
View File
@@ -0,0 +1,10 @@
services:
server:
build:
context: .
dockerfile: Dockerfile
ports:
- "3000:3000"
volumes:
- ./data:/app/data
command: /app/server