Add dockerfile and workflow
Docker / build-and-push-image (push) Successful in 36s

This commit is contained in:
Jon Staab
2026-06-12 15:11:51 -07:00
parent 874066110c
commit de169161dc
3 changed files with 92 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
# syntax=docker/dockerfile:1
# ---- Build stage: compile the Vite/SolidJS app to static files ----
FROM node:24-alpine AS build
WORKDIR /app
# pnpm ships with Node via corepack; pin to the version that produced pnpm-lock.yaml.
RUN corepack enable && corepack prepare pnpm@10.33.0 --activate
# Install deps first so this layer is cached unless the manifest/lockfile change.
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
# Build (`tsc && vite build` → /app/dist). devDependencies are needed here.
COPY . .
RUN pnpm build
# ---- Serve stage: static files via `serve` ----
FROM node:24-alpine AS serve
WORKDIR /app
# `serve` (what `npx serve` runs) — installed at build time so the image is self-contained.
RUN npm install -g serve@14
COPY --from=build /app/dist ./dist
EXPOSE 3000
CMD ["serve", "-s", "dist", "-l", "3000"]