ECS-Cloudformation/nginx/Dockerfile
2023-09-10 16:56:04 +03:00

32 lines
973 B
Docker

# Use the official Nginx base image
FROM nginx:latest
# 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/
# Copy Nginx configuration file for HTTP
COPY nginx.conf /etc/nginx/custom/nginx.conf
# Copy SSL/TLS certificate and key
COPY certificates/commit-kfir.crt /etc/nginx/ssl/
COPY certificates/commit-kfir.key /etc/nginx/ssl/
# 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 ports 80 for HTTP and 443 for HTTPS
EXPOSE 80
EXPOSE 443
# Define the command to start Nginx using your custom script
CMD ["/usr/local/bin/start-nginx.sh"]