Enhance Dockerfile: add system dependencies for building Python packages, update requirements.txt to remove specific version constraints, and verify installations with pip list.

This commit is contained in:
2025-04-20 19:31:13 +01:00
parent e9fe907af0
commit 4310239a7a
2 changed files with 18 additions and 7 deletions

View File

@@ -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"]

View File

@@ -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
Flask
Flask-Login
Flask-SQLAlchemy
Werkzeug
SQLAlchemy
email_validator