mckabue's picture
If you're using an older Python version (3.9 or earlier), replace the match statement with an equivalent if-elif structure:
f199f03
raw
history blame
679 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.10
RUN useradd -m -u 1000 user
WORKDIR /app
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
RUN apt-get -y update && apt-get -y install whois && apt-get -y install netbase
COPY --chown=user . /app
# CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]
# Use Gunicorn to run the Quart application
# https://github.com/benoitc/gunicorn/issues/2109#issuecomment-530030943
# https://www.uvicorn.org/#hypercorn
CMD ["hypercorn", "--bind", "0.0.0.0:7860", "app:app"]