Files
valtrix-website/Containerfile
2025-11-10 07:36:17 +01:00

27 lines
571 B
Docker

# Multi-stage build for Astro static site
FROM node:22-alpine AS builder
ENV ASTRO_TELEMETRY_DISABLED=1
WORKDIR /app
# Install deps
COPY package*.json ./
RUN npm ci || npm install
# Copy sources and build static output
COPY . .
RUN npm run build
# ---- Runtime stage ----
FROM node:22-alpine AS runtime
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=3000
ENV WEB_ROOT=/app/dist
ENV TZ=Europe/Berlin
COPY --from=builder /app/dist /app/dist
COPY server.mjs /app/server.mjs
# Drop root: use the pre-created node user
USER node
#EXPOSE 3000
CMD ["node", "/app/server.mjs"]