feat: implement Docker-based production deployment pipeline with automated Ansible provisioning, CI/CD workflows, and Caddy server configuration.
Some checks failed
On Push to Main / test (push) Has been cancelled
On Push to Main / publish (push) Has been cancelled
On Push to Main / deploy-dev (push) Has been cancelled

This commit is contained in:
RaymondVerhoef
2026-05-14 10:21:42 +02:00
parent 3a4f6d7c22
commit e783c5f1e7
16 changed files with 453 additions and 18 deletions

View File

@@ -1,28 +1,21 @@
# Stage 1: Build the React application
FROM node:22-alpine as build
FROM node:24-alpine AS builder
WORKDIR /app
# Copy package files and install dependencies
COPY package*.json ./
RUN npm install
COPY package.json package-lock.json ./
RUN npm ci
# Copy the rest of the application files
COPY . .
# Build the Vite project for production
RUN npm run build
ARG BUILD_MODE=development
RUN npm run build -- --mode $BUILD_MODE
# Stage 2: Serve the application with Nginx
FROM nginx:alpine
FROM caddy:2-alpine
# Copy custom Nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/dist /srv
COPY Caddyfile /etc/caddy/Caddyfile
# Copy the build output to Nginx's html directory
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80 443
# Expose port 80
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost/ || exit 1