diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5c6acc2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +# syntax=docker/dockerfile:1 + +# ---- Builder: install deps + build a standalone Node server (.output/) ---- +FROM oven/bun:1 AS builder +WORKDIR /app + +# Install dependencies against the committed lockfile +COPY package.json bun.lock ./ +RUN bun install --frozen-lockfile + +# Copy the rest of the source. .env is copied too so Vite bakes the +# VITE_SUPABASE_* values into the client bundle at build time (public-safe). +COPY . . + +# Build with the Nitro node-server preset -> self-contained .output/ +ENV NITRO_PRESET=node-server +RUN bun run build + +# ---- Runner: run the built server on Node (no install needed, .output is standalone) ---- +FROM node:22-slim AS runner +WORKDIR /app +ENV NODE_ENV=production +# Nitro node-server reads HOST/PORT; 0.0.0.0:3000 is the default we expose. +ENV HOST=0.0.0.0 +ENV PORT=3000 + +COPY --from=builder /app/.output ./.output + +EXPOSE 3000 +CMD ["node", ".output/server/index.mjs"]