FROM python:3.11-slim WORKDIR /app # Install build deps needed for some packages (cryptography, etc.) then remove them RUN apt-get update && \ apt-get install -y --no-install-recommends build-essential libssl-dev libffi-dev curl ca-certificates && \ rm -rf /var/lib/apt/lists/* COPY requirements.txt ./ RUN pip install --upgrade pip && \ pip install --no-cache-dir -r requirements.txt # Copy application COPY . /app #ENV FLASK_APP=app:create_app EXPOSE 5000 # Healthcheck: call the Flask /health endpoint HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \ CMD curl -fS http://127.0.0.1:5000/health || exit 1 CMD ["flask", "--app" , "app", "run", "--host=0.0.0.0"]