Spaces:
Sleeping

pegos-data / Dockerfile
Caner7's picture
Update Dockerfile
f7bd8a8 verified
Raw History Blame Contribute Delete
734 Bytes
# =====================================================
# Dockerfile — Pegos Data API (FastAPI + HF Spaces)
# =====================================================
FROM python:3.10-slim
# Sistem güncellemeleri ve bağımlılıklar
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
# Uygulama dizini
WORKDIR /app
# Python bağımlılıklarını yükle
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Uygulama dosyalarını kopyala
COPY . .
# Hugging Face Spaces uyumlu dinamik port
ENV PORT=7860
EXPOSE $PORT
# Non-root kullanıcı
RUN useradd -m user
USER user
# FastAPI sunucusunu başlat
CMD ["sh", "-c", "uvicorn app.main:app --host 0.0.0.0 --port $PORT"]