pure-sense-api / Dockerfile
puresenseai's picture
Update Dockerfile
dfdd2d2 verified
raw
history blame contribute delete
769 Bytes
# Python 3.10 kullanıyoruz
FROM python:3.10
# Çalışma klasörünü ayarla
WORKDIR /code
# --- DÜZELTME BURADA ---
# libgl1-mesa-glx yerine 'libgl1' ve 'libglib2.0-0' yüklüyoruz.
# Bu paketler OpenCV'nin sunucuda hatasız çalışmasını sağlar.
RUN apt-get update && apt-get install -y libgl1 libglib2.0-0
# Gereksinimleri kopyala ve yükle
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Kullanıcı ayarları (Hugging Face standardı)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
# Kodları kopyala
COPY --chown=user . $HOME/app
# Uygulamayı başlat
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]