Performance: Docker containerization
MEDIUM IMPACT
Docker containerization affects application startup time, resource usage, and deployment speed, impacting how quickly a Flask app becomes responsive.
FROM python:3.12-slim WORKDIR /app COPY requirements.txt /app/ RUN pip install --no-cache-dir -r requirements.txt COPY . /app CMD ["python", "app.py"]
FROM python:3.12 WORKDIR /app COPY . /app RUN pip install -r requirements.txt CMD ["python", "app.py"]
| Pattern | Image Size | Startup Time | Resource Usage | Verdict |
|---|---|---|---|---|
| Large base image with full copy | 500MB+ | 5+ seconds | High CPU and memory | [X] Bad |
| Slim base image with layered caching | 200MB | 2 seconds | Optimized CPU and memory | [OK] Good |