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:
13
Dockerfile
13
Dockerfile
@@ -2,10 +2,18 @@ FROM python:3.11-slim
|
|||||||
|
|
||||||
WORKDIR /app
|
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
|
# Clean up and install requirements
|
||||||
RUN rm -rf /app/*
|
RUN rm -rf /app/*
|
||||||
COPY requirements.txt .
|
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 application files
|
||||||
COPY website/ ./website/
|
COPY website/ ./website/
|
||||||
@@ -13,4 +21,7 @@ COPY requirements.txt .
|
|||||||
|
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
|
|
||||||
|
# Verify installations
|
||||||
|
RUN pip list
|
||||||
|
|
||||||
CMD ["python", "website/app.py"]
|
CMD ["python", "website/app.py"]
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
Flask==3.0.2
|
Flask
|
||||||
Flask-Login==0.6.3
|
Flask-Login
|
||||||
Flask-SQLAlchemy==3.1.1
|
Flask-SQLAlchemy
|
||||||
Werkzeug==3.0.1
|
Werkzeug
|
||||||
SQLAlchemy==2.0.28
|
SQLAlchemy
|
||||||
email_validator==2.1.1
|
email_validator
|
||||||
Reference in New Issue
Block a user