- Replace local deployment with proper CI/CD pipeline - Add lint job as first stage (fail-fast) - Build and push Docker image to Harbor registry - Deploy via SSH with image tag from commit SHA - Add deployment verification with health check - Update Dockerfile to Node 20 and fix npm ci - Support IMAGE variable in docker-compose for deployments Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
29 lines
492 B
Docker
29 lines
492 B
Docker
# Build stage
|
|
FROM node:20-alpine as build
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies (including devDependencies needed for build)
|
|
RUN npm ci
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build the app
|
|
RUN npm run build
|
|
|
|
# Production stage
|
|
FROM nginx:alpine
|
|
|
|
# Copy built app to nginx
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|
|
|
|
# Copy custom nginx config (optional)
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["nginx", "-g", "daemon off;"] |