test-app-stack/frontend/Dockerfile
mane a346cf3a5c Initial commit: ElysiaJS backend + TanStack Start frontend + Traefik compose
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 04:01:48 +00:00

19 lines
569 B
Docker

# --- Frontend: TanStack Start (SSR, Node runtime) ---
FROM node:22-alpine AS build
WORKDIR /app
# VITE_API_URL must be present at build time: Vite inlines it into the bundle.
ARG VITE_API_URL
ENV VITE_API_URL=${VITE_API_URL}
COPY package.json package-lock.json* ./
RUN npm ci || npm install
COPY . .
RUN npm run build
FROM node:22-alpine AS runtime
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=3000
# TanStack Start (Vite) emits a self-contained server bundle in .output.
COPY --from=build /app/.output ./.output
EXPOSE 3000
CMD ["node", ".output/server/index.mjs"]