Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/nperez0111/bookhive. Track your books, share your shelves, see what others are reading bookhive.buzz
atproto bluesky books bookshelf goodreads management-system
Something went wrong. Try again.
bookhive Dockerfile
1.4 kB · 32 lines
Dockerfile
123456789101112131415161718192021222324252627282930313233# syntax=docker/dockerfile:1FROM oven/bun:1.3.9-alpine AS baseWORKDIR /usr/src/appRUN rm -rf /var/cache/apk/*
FROM base AS depsCOPY package.json bun.lock* ./COPY patches/ ./patches/COPY scripts/strip-workspaces.ts ./scripts/RUN bun run scripts/strip-workspaces.ts && rm -f bun.lock bun.lockb && bun install
FROM deps AS buildCOPY . .RUN bun run build
FROM base AS finalARG BUILD_SHAENV BUILD_SHA=${BUILD_SHA} NODE_ENV=production PORT=8080# Own the workdir as root before switching userRUN chown bun:bun /usr/src/appUSER bun# Nitro bundles all JS and traces native deps (sharp) into .output/server/node_modules — no bun install neededCOPY --chown=bun:bun --from=build /usr/src/app/.output ./.output# @takumi-rs/core is a NAPI-RS package; Nitro's tracer only auto-detects packages in nf3's# NodeNativePackages list (e.g. sharp). Copy the full @takumi-rs scope so the platform-specific# binary (e.g. core-linux-arm64-musl) is available at runtime.# TODO: remove once https://github.com/nitrojs/nitro/issues/4140 is fixed upstream.COPY --chown=bun:bun --from=build /usr/src/app/node_modules/@takumi-rs ./.output/server/node_modules/@takumi-rsEXPOSE 8080HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ CMD wget -qO- http://localhost:8080/healthcheck || exit 1CMD ["bun", "run", ".output/server/index.mjs"]