FROM nginx:alpine # Copy website files to nginx html directory COPY index.html /usr/share/nginx/html/ COPY styles.css /usr/share/nginx/html/ COPY script.js /usr/share/nginx/html/ # Create assets directory and copy source files RUN mkdir -p /usr/share/nginx/html/assets COPY assets/ /usr/share/nginx/html/assets/ # Copy custom nginx configuration COPY nginx.conf /etc/nginx/conf.d/default.conf # Create robots.txt and sitemap.xml RUN echo -e "User-agent: *\nAllow: /\n\nSitemap: /sitemap.xml" > /usr/share/nginx/html/robots.txt RUN echo -e '\n\n \n https://your-domain.com/\n 2024-10-05\n weekly\n 1.0\n \n' > /usr/share/nginx/html/sitemap.xml # Set proper permissions RUN chown -R nginx:nginx /usr/share/nginx/html && \ chmod -R 644 /usr/share/nginx/html/* && \ chmod 755 /usr/share/nginx/html/ EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]