FROM python:3.10.9 WORKDIR /app COPY . /app # Create necessary directories and set permissions only for what we need RUN mkdir -p /app/output && \ mkdir -p /app/matplotlib && \ mkdir -p /app/ipython && \ mkdir -p /app/kernels && \ chmod -R 777 /app/output && \ chmod -R 777 /app/matplotlib && \ chmod -R 777 /app/ipython && \ chmod -R 777 /app/kernels # Set environment variables ENV MPLCONFIGDIR=/app/matplotlib ENV IPYTHONDIR=/app/ipython ENV JUPYTER_RUNTIME_DIR=/app/kernels # Install requirements RUN pip install --no-cache-dir -r requirements.txt EXPOSE 7860 CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]