File size: 848 Bytes
54b154a f630bbd 54b154a 357de7f f630bbd 0f8f9fc f630bbd 54b154a f630bbd | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | FROM python:3.11.6-slim
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
g++ \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Ensure all directories exist
RUN find . -type d -exec mkdir -p {} \; 2>/dev/null || true
# Set PYTHONPATH to include the current directory and all subdirectories
ENV PYTHONPATH=/app:/app/controller:/app/controller/models:/app/models:/app/utils
# Make startup script executable
RUN chmod +x /app/startup.sh
# Expose port
EXPOSE 7860
# Run the startup script
WORKDIR /app
CMD ["/bin/bash", "/app/startup.sh"] |