trysomething1 / Dockerfile
dragonxd1's picture
Update Dockerfile
9e5c789 verified
raw
history blame contribute delete
641 Bytes
FROM python:3.10-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
bash \
dnsutils \
curl \
ffmpeg \
sudo \
&& rm -rf /var/lib/apt/lists/*
# Working directory
WORKDIR /app
# Copy launcher
COPY app.py .
# Install Python dependencies
RUN pip install --no-cache-dir fastapi uvicorn httpx
# HuggingFace Spaces port
EXPOSE 7860
# Startup: try to change DNS then start server
CMD sh -c 'echo "nameserver 1.1.1.1" | sudo tee /etc/resolv.conf >/dev/null 2>&1; \
echo "nameserver 1.0.0.1" | sudo tee -a /etc/resolv.conf >/dev/null 2>&1; \
uvicorn app:app --host 0.0.0.0 --port 7860'