FROM nginx:1.25-alpine # Copy custom nginx configuration COPY nginx.conf /etc/nginx/nginx.conf # Create log directory RUN mkdir -p /var/log/nginx # Set proper permissions RUN chown -R nginx:nginx /var/log/nginx RUN chown -R nginx:nginx /var/cache/nginx # Add healthcheck HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ CMD curl -f http://localhost/health || exit 1 # Expose port EXPOSE 80 # Start nginx CMD ["nginx", "-g", "daemon off;"]