modified: Dockerfile
This commit is contained in:
21
Dockerfile
21
Dockerfile
@@ -1,12 +1,29 @@
|
|||||||
FROM python:3.11-slim
|
FROM python:3.11-slim
|
||||||
|
|
||||||
|
# Install system dependencies for eventlet/production networking
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
gcc \
|
||||||
|
python3-dev \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY requirements.txt ./
|
# Install requirements first to leverage Docker cache
|
||||||
|
COPY requirements.txt .
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
COPY app.py ./
|
# Copy the application files
|
||||||
|
COPY app.py .
|
||||||
COPY templates/ ./templates/
|
COPY templates/ ./templates/
|
||||||
|
# Copy static folder, ensuring cache subfolder exists
|
||||||
COPY static/ ./static/
|
COPY static/ ./static/
|
||||||
|
RUN mkdir -p /app/static/cache
|
||||||
|
|
||||||
|
# Expose the port Flask is running on
|
||||||
|
EXPOSE 5000
|
||||||
|
|
||||||
|
# Set environment variables for Flask
|
||||||
|
ENV FLASK_ENV=production
|
||||||
|
ENV PYTHONUNBUFFERED=1
|
||||||
|
|
||||||
CMD ["python", "app.py"]
|
CMD ["python", "app.py"]
|
||||||
Reference in New Issue
Block a user