This is an old revision of the document!
Docker : Building and Deploying a Docker Image and push it to Docker Hub
This guide walks you through containerizing an application using Docker. You'll write a Dockerfile, build the image, run it as a container, and push it to Docker Hub.
Step 1: App Project Structure
Demo-App ├── Dockerfile ├── index.html └── nginx.conf
Step 2: Create Dockerfile
Create a `Dockerfile` in the same directory:
# Use the official Python image FROM python:3.10-slim # Set working directory WORKDIR /app # Copy files COPY . . # Install dependencies RUN pip install flask # Expose port EXPOSE 5000 # Run the application CMD ["python", "app.py"]