mirror of
https://github.com/zkldi/Tachi.git
synced 2026-09-27 01:20:31 +03:00
39 lines
878 B
Docker
39 lines
878 B
Docker
# Build context must be the repo root.
|
|
# docker build -f docker/Dockerfile.ghbot .
|
|
|
|
FROM oven/bun:alpine AS base
|
|
WORKDIR /app
|
|
|
|
# --- deps: install ALL deps (dev included, needed for the build) ---
|
|
FROM base AS deps
|
|
|
|
COPY package.json bun.lock bunfig.toml ./
|
|
COPY patches ./patches
|
|
|
|
COPY typescript/github-bot/package.json ./typescript/github-bot/
|
|
|
|
RUN bun install --frozen-lockfile
|
|
|
|
# --- build: compile everything into a single native binary ---
|
|
FROM deps AS build
|
|
|
|
COPY typescript/github-bot ./typescript/github-bot
|
|
|
|
RUN bun build \
|
|
--compile \
|
|
--target=bun \
|
|
./typescript/github-bot/src/main.ts \
|
|
--outfile /ghbot
|
|
|
|
# --- prod: nothing but the binary ---
|
|
FROM alpine:3.21 AS prod
|
|
|
|
RUN apk add --no-cache curl
|
|
|
|
COPY --from=build /ghbot /ghbot
|
|
|
|
HEALTHCHECK --interval=15s --timeout=5s \
|
|
CMD curl -sf http://localhost:${PORT:-8080}/.deploy/up || exit 1
|
|
|
|
CMD ["/ghbot"]
|