Push main branch code to Release branch
Some checks failed
DevSecOps-Multibranch/pipeline/head There was a failure building this commit

This commit is contained in:
2025-11-30 15:29:04 +05:30
parent 049326a8fe
commit 3c513989ae
25 changed files with 22458 additions and 0 deletions

47
frontend/Dockerfile Normal file
View File

@@ -0,0 +1,47 @@
# Multi-stage build for React frontend
FROM node:18-alpine AS build
# Set working directory
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci
# Copy source code
COPY public/ ./public/
COPY src/ ./src/
# Build the application
RUN npm run build
# Production stage with Nginx
FROM nginx:alpine AS production
# Copy custom nginx config
COPY nginx.conf /etc/nginx/nginx.conf
# Copy built React app
COPY --from=build /app/build /usr/share/nginx/html
# Create a non-root user for nginx
RUN addgroup -g 1001 -S nginxgroup && \
adduser -S nginxuser -u 1001 -G nginxgroup
# Change ownership of nginx directories
RUN chown -R nginxuser:nginxgroup /var/cache/nginx && \
chown -R nginxuser:nginxgroup /var/log/nginx && \
chown -R nginxuser:nginxgroup /etc/nginx/conf.d && \
chown -R nginxuser:nginxgroup /usr/share/nginx/html
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:80/ || exit 1
# Expose port
EXPOSE 80
# Start nginx
CMD ["nginx", "-g", "daemon off;"]