Creating an **NGINX Docker image using a Dockerfile** is a great way to customize your web server setup. Here’s a step-by-step guide to help you do that. ✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨ ### 🛠 1. **Create a Project Directory** ```bash mkdir custom-nginx cd custom-nginx ``` ✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨ ### 📄 2. **Create a `Dockerfile`** Here’s a basic example of a Dockerfile that sets up NGINX: ```Dockerfile # Use official NGINX base image FROM nginx:latest # Maintainer info (optional) LABEL maintainer="you@example.com" # Copy custom NGINX config file (if any) # COPY nginx.conf /etc/nginx/nginx.conf # Copy your static website files (optional) # COPY ./html /usr/share/nginx/html # Expose port 80 EXPOSE 80 # Start NGINX (default command is already correct, so this line is optional) CMD ["nginx", "-g", "daemon off;"] ``` > You can uncomment and add your custom config or HTML files if you have them. ✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨ FROM nginx:latest LABEL maintainer="infocusm21@gmail.com" COPY web-data1/. /usr/share/nginx/html/ WORKDIR /usr/share/nginx/html/ EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] ✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨ ### 🧾 3. **(Optional) Add HTML or Config** You can add custom files: ```bash mkdir html echo "

Hello from custom NGINX Docker image!

" > html/index.html ``` Then, update your Dockerfile to: ```Dockerfile COPY ./html /usr/share/nginx/html ``` ✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨ ### 🧱 4. **Build the Docker Image** ```bash docker build -t my-custom-nginx . ``` ✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨ ### 🚀 5. **Run the Container** ```bash docker run -d -p 8080:80 --name nginx-container my-custom-nginx ``` Now, open your browser and go to: 📍 `http://localhost:8080` — you should see your HTML content. ✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨ Would you like to customize NGINX more deeply (like using reverse proxy or load balancing configs)? I can help with that too.