Sure! Here's how to create a **custom Apache Tomcat Docker image using a Dockerfile** — similar idea to NGINX, but with a focus on serving Java web applications (`.war` files). ✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨ ### 🛠 1. **Create a Project Directory** ```bash mkdir custom-tomcat cd custom-tomcat ``` ✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨ ### 📄 2. **Create a `Dockerfile`** ```Dockerfile # Use the official Tomcat base image FROM tomcat:9.0 # Maintainer (optional) LABEL maintainer="infocusm21@gmail.com" # Optional: Remove default web apps (cleaner) RUN rm -rf /usr/local/tomcat/webapps/* # Copy your WAR file to the webapps folder # (Assuming you place your .war file in this directory) COPY webapp-war/* /usr/local/tomcat/webapps/ # Expose Tomcat's default port EXPOSE 8080 # Start Tomcat (default CMD works, but for clarity:) CMD ["catalina.sh", "run"] ``` ✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨ ### 📦 3. **Add Your WAR File** Place your compiled `.war` file (e.g., `myapp.war`) in the same directory as the Dockerfile. If you don’t have a WAR yet, you can just create a dummy one for testing or skip the `COPY` step. ✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨ ### 🧱 4. **Build the Docker Image** ```bash docker build -t my-custom-tomcat . ``` ✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨ ### 🚀 5. **Run the Container** ```bash docker run -d -p 8080:8080 --name tomcat-container my-custom-tomcat ``` Open your browser and go to: 📍 `http://localhost:8080/myapp` — and you should see your web app loading! ✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨ If you want to: - Deploy multiple `.war` files - Use a custom `server.xml` or `context.xml` - Add environment variables for database configs I can help you extend the Dockerfile or use Docker Compose as well. Let me know what kind of project you’re deploying on Tomcat.