- Multi-stage Dockerfile (node build + nginx:alpine serve) - nginx.conf with SPA fallback, gzip, asset caching - docker-compose.yml for easy deployment - GitHub Actions workflow to build & push to ghcr.io on every push - .dockerignore to keep image lean - Updated README with Docker-first quick start and badge
15 lines
314 B
Docker
15 lines
314 B
Docker
# Stage 1: Build
|
|
FROM node:22-alpine AS build
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
# Stage 2: Serve
|
|
FROM nginx:alpine
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
EXPOSE 80
|
|
CMD ["nginx", "-g", "daemon off;"]
|