# Use the official Python 3.10 slim image FROM python:3.10-slim # Environment settings ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 # Set working directory WORKDIR /app # Install required system packages RUN apt-get update && apt-get install -y procps wget && apt-get clean # Download requirements.txt first for dependency caching RUN wget https://huggingface.co/datasets/SuperAPIs/Data/resolve/main/requirements.txt # Install Python dependencies RUN pip install --no-cache-dir --upgrade pip RUN pip install --no-cache-dir -r requirements.txt # Download main.py RUN wget https://huggingface.co/datasets/SuperAPIs/Data/resolve/main/main.py # Create the 'api' folder and download all internal API files RUN mkdir api && cd api && \ wget https://huggingface.co/datasets/SuperAPIs/Data/resolve/main/api/app.py && \ wget https://huggingface.co/datasets/SuperAPIs/Data/resolve/main/api/auth.py && \ wget https://huggingface.co/datasets/SuperAPIs/Data/resolve/main/api/config.py && \ wget https://huggingface.co/datasets/SuperAPIs/Data/resolve/main/api/logger.py && \ wget https://huggingface.co/datasets/SuperAPIs/Data/resolve/main/api/utils.py && \ wget https://huggingface.co/datasets/SuperAPIs/Data/resolve/main/api/models.py && \ wget https://huggingface.co/datasets/SuperAPIs/Data/resolve/main/api/routes.py && \ wget https://huggingface.co/datasets/SuperAPIs/Data/resolve/main/api/validate.py # Expose port EXPOSE 8001 # Start the FastAPI app using uvicorn CMD ["sh", "-c", "uvicorn main:app --host 0.0.0.0 --port 8001 --workers $(nproc)"]