From 4310239a7a85442b4fd7e371555b545da40b8155 Mon Sep 17 00:00:00 2001 From: marwin Date: Sun, 20 Apr 2025 19:31:13 +0100 Subject: [PATCH] Enhance Dockerfile: add system dependencies for building Python packages, update requirements.txt to remove specific version constraints, and verify installations with pip list. --- Dockerfile | 13 ++++++++++++- requirements.txt | 12 ++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 33b4c35..b670f9f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,18 @@ FROM python:3.11-slim WORKDIR /app +# System dependencies +RUN apt-get update && apt-get install -y \ + gcc \ + python3-dev \ + libffi-dev \ + && rm -rf /var/lib/apt/lists/* + # Clean up and install requirements RUN rm -rf /app/* COPY requirements.txt . -RUN pip install --no-cache-dir -r requirements.txt +RUN pip install --no-cache-dir -r requirements.txt \ + && pip install --no-cache-dir wheel setuptools # Copy application files COPY website/ ./website/ @@ -13,4 +21,7 @@ COPY requirements.txt . EXPOSE 5000 +# Verify installations +RUN pip list + CMD ["python", "website/app.py"] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 7231e24..5963cc4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -Flask==3.0.2 -Flask-Login==0.6.3 -Flask-SQLAlchemy==3.1.1 -Werkzeug==3.0.1 -SQLAlchemy==2.0.28 -email_validator==2.1.1 \ No newline at end of file +Flask +Flask-Login +Flask-SQLAlchemy +Werkzeug +SQLAlchemy +email_validator \ No newline at end of file