FROM nginx:alpine # Remove the default Nginx configuration file RUN rm /etc/nginx/conf.d/default.conf # Copy the custom Nginx configuration file COPY ./nginx/nginx.conf /etc/nginx/nginx.conf # Ensure the directory exists and set permissions if needed RUN mkdir -p /var/www/html && \ chown -R nginx:nginx /var/www/html && \ chmod -R 755 /var/www/html EXPOSE 80 # Start Nginx in the foreground to keep the container running CMD ["nginx", "-g", "daemon off;"]