ECS-Cloudformation/nginx/Dockerfile
2023-09-10 10:14:03 +03:00

27 lines
815 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
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"]