Spaces:
Runtime error
Runtime error
File size: 964 Bytes
6c7d02a 3671cba ee259c3 6c7d02a 547bb4e 76c6315 f13d727 ddcb644 df79f0c 986428e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
FROM python:3.10
WORKDIR /code
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
COPY --chown=user . $HOME/app
#CMD ["gunicorn", "main:app", "--bind", "0.0.0.0:10000"]
#似乎端口必须是7860???是的!App port: Your Docker Space needs to listen on port 7860
#CMD ["gunicorn", "-b", "0.0.0.0:7860", "main:app"] #OKed
#CMD ["gunicorn", "-bind", "0.0.0.0:7860", "main:app"] #Failed
CMD ["gunicorn", "main:app", "-b", "0.0.0.0:7860"] #Oked
#CMD ["gunicorn", "main:app", "--bind", "0.0.0.0:7860"]
#模板给的是CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
#模板适用的是uvicorn;而gunicorn可能必须采用CMD ["gunicorn", "-b", "0.0.0.0:7860", "main:app"]这种形式
#如何设置Dockerfile:https://huggingface.co/docs/hub/spaces-sdks-docker |