2026-02-21 15:00:05 +05:30
|
|
|
FROM python:3.11-slim
|
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
# Install system dependencies
|
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
|
gcc \
|
2026-08-06 18:17:33 +05:30
|
|
|
default-libmysqlclient-dev \
|
|
|
|
|
pkg-config \
|
2026-02-21 15:00:05 +05:30
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
# Copy requirements and install Python dependencies
|
|
|
|
|
COPY requirements.txt .
|
2026-08-06 18:17:33 +05:30
|
|
|
RUN pip install --no-cache-dir -r requirements.txt gunicorn
|
2026-02-21 15:00:05 +05:30
|
|
|
|
|
|
|
|
# Copy application code
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
|
|
# Create necessary directories
|
|
|
|
|
RUN mkdir -p app/logs app/static/uploads app/static/downloads
|
2026-08-06 18:17:33 +05:30
|
|
|
ENV FLASK_APP=run.py
|
2026-02-21 15:00:05 +05:30
|
|
|
|
|
|
|
|
# Expose port
|
|
|
|
|
EXPOSE 5001
|
|
|
|
|
|
2026-08-06 18:17:33 +05:30
|
|
|
# Run the application with Gunicorn (production WSGI server)
|
|
|
|
|
CMD ["gunicorn", "--bind", "0.0.0.0:5001", "run:app"]
|