ECS-Cloudformation/nginx/Dockerfile

33 lines
973 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 13:56:04 +00:00
# Copy Nginx configuration file for HTTP
2023-09-10 07:14:03 +00:00
COPY nginx.conf /etc/nginx/custom/nginx.conf
2023-09-10 13:56:04 +00:00
# Copy SSL/TLS certificate and key
COPY certificates/commit-kfir.crt /etc/nginx/ssl/
COPY certificates/commit-kfir.key /etc/nginx/ssl/
2023-09-10 07:14:03 +00:00
# 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
2023-09-10 13:56:04 +00:00
# Expose ports 80 for HTTP and 443 for HTTPS
2023-09-10 07:14:03 +00:00
EXPOSE 80
2023-09-10 13:56:04 +00:00
EXPOSE 443
2023-09-10 07:14:03 +00:00
# Define the command to start Nginx using your custom script
CMD ["/usr/local/bin/start-nginx.sh"]