Files
nick 3f81ff072c
Publish Docker image / build-and-push (push) Failing after 4m20s
runner and docker
2026-07-16 14:24:04 -07:00

34 lines
739 B
Docker

# syntax=docker/dockerfile:1
# ---- Build stage ----
FROM node:22-alpine AS build
WORKDIR /app
# Install dependencies against the lockfile for reproducible builds
COPY package.json package-lock.json ./
RUN npm ci
# Build the Vite app (outputs to /app/dist)
COPY . .
RUN npm run build
# ---- Runtime stage ----
FROM node:22-alpine AS runtime
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=3001
# Only production dependencies are needed to run the Express server
COPY package.json package-lock.json ./
RUN npm ci --omit=dev && npm cache clean --force
# Copy the built static assets and the server
COPY --from=build /app/dist ./dist
COPY server.js ./
# Run as the built-in non-root user
USER node
EXPOSE 3001
CMD ["node", "server.js"]