Salimshakeel's picture
fix container
7db9110
raw
history blame
703 Bytes
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
# You will also find guides on how best to write your Dockerfile
FROM python:3.12-slim
ENV TORCH_HOME=/tmp/torch_cache
WORKDIR /code
COPY ./requirements.txt /code/requirements.txt
RUN apt-get update && apt-get install -y libgl1 libglib2.0-0
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r /code/requirements.txt
RUN adduser --disabled-password --gecos '' appuser \
&& mkdir -p /code/static/uploads \
&& mkdir -p /code/static/outputs \
&& chown -R appuser /code
COPY . .
RUN chown -R appuser /code
USER appuser
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]