ci) add gitea actions and refresh readme #1
16
Dockerfile
16
Dockerfile
@@ -1,5 +1,5 @@
|
|||||||
# ── Build stage ────────────────────────────────────────────────────────────────
|
# ── Build stage ────────────────────────────────────────────────────────────────
|
||||||
FROM oven/bun:1 AS builder
|
FROM node:22-bookworm-slim AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@@ -9,27 +9,25 @@ RUN apt-get update \
|
|||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Copy dependency manifests first for better layer caching
|
# Copy dependency manifests first for better layer caching
|
||||||
COPY package.json bun.lock ./
|
COPY package.json ./
|
||||||
|
|
||||||
# Install all deps (including devDependencies needed for the build).
|
# Install all deps (including devDependencies needed for the build).
|
||||||
# better-sqlite3 is a native module — it must be compiled here on Linux,
|
RUN npm install
|
||||||
# not copied from a macOS node_modules.
|
|
||||||
RUN bun install --frozen-lockfile
|
|
||||||
|
|
||||||
# Copy source and build
|
# Copy source and build
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN bun run build
|
RUN npm run build
|
||||||
|
|
||||||
# Prune to production-only deps, recompiling native modules for Linux
|
# Prune to production-only deps, recompiling native modules for Linux
|
||||||
RUN bun install --frozen-lockfile --production
|
RUN npm prune --omit=dev
|
||||||
|
|
||||||
# ── Runtime stage ───────────────────────────────────────────────────────────────
|
# ── Runtime stage ───────────────────────────────────────────────────────────────
|
||||||
FROM node:22-alpine AS runtime
|
FROM node:22-bookworm-slim AS runtime
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Create a non-root user to run the app
|
# Create a non-root user to run the app
|
||||||
RUN addgroup -S trips && adduser -S trips -G trips
|
RUN groupadd --system trips && useradd --system --gid trips trips
|
||||||
|
|
||||||
# Copy the built app and production node_modules from the builder
|
# Copy the built app and production node_modules from the builder
|
||||||
COPY --from=builder /app/build ./build
|
COPY --from=builder /app/build ./build
|
||||||
|
|||||||
Reference in New Issue
Block a user