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
|
||||
|
||||
# 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"]
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user