ECS-Cloudformation/nginx/Dockerfile

28 lines
815 B
Docker
Raw Normal View History

2023-09-10 07:14:03 +00:00
# Use the official Nginx base image
FROM nginx:latest
2023-09-10 07:14:03 +00:00
# Create a directory to store your custom Nginx configuration
RUN mkdir -p /etc/nginx/custom
# Install MySQL client library (if needed)
# RUN apt-get update && apt-get install -y default-mysql-client
# Copy your custom HTML and logo files to the Nginx web root
COPY index.html /usr/share/nginx/html/
COPY logo.png /usr/share/nginx/html/
2023-09-10 07:14:03 +00:00
# Copy Nginx configuration file
COPY nginx.conf /etc/nginx/custom/nginx.conf
# Copy a custom script that will start Nginx and keep it running
COPY start-nginx.sh /usr/local/bin/start-nginx.sh
# Make the script executable
RUN chmod +x /usr/local/bin/start-nginx.sh
# Expose port 80 for incoming HTTP traffic
EXPOSE 80
# Define the command to start Nginx using your custom script
CMD ["/usr/local/bin/start-nginx.sh"]