File size: 1,588 Bytes
346f94c |
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 39 |
# 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)"] |