# --doc: https://huggingface.co/docs/hub/spaces-sdks-docker | |
FROM python:3.10 | |
RUN useradd -m -u 1000 user | |
USER user | |
ENV HOME=/home/user \ | |
PATH=/home/user/.local/bin:$PATH | |
WORKDIR /home/user/app | |
# --cp w/ explicit user permissions βπ½π¬β π«΅πΌ | |
COPY --chown=user:user requirements.txt . | |
RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
COPY --chown=user:user . . | |
ENV CHAINLIT_HOME=/home/user/.chainlit \ | |
XDG_CACHE_HOME=/home/user/.cache | |
#ENV CHAINLIT_AUTH_SECRET=your_secret_value | |
RUN mkdir -p $CHAINLIT_HOME $XDG_CACHE_HOME | |
#CMD rm -f /home/user/.local/lib/python3.10/site-packages/chainlit/config.py && \ | |
#chainlit run app.py -h 0.0.0.0 -p 7860 | |
#CMD chainlit init | |
CMD chainlit run --host 0.0.0.0 --watch --port 7860 app.py | |
# 7860 | |
# -w, --watch: Reload the app when the module changes. When this option is specified, the file watcher will be started and any changes to files will cause the server to reload the app, allowing faster iterations. | |
# -h, --headless: Prevents the app from opening in the browser. | |
# -d, --deb"b"ug: Sets the log level to debug. Default log level is error. | |
# -c, --ci: Runs in CI mode. | |
# --no-cache: Disables third parties cache, such as langchain. | |
# --host: Specifies a different host to run the server on. | |
# --port: Specifies a different port to run the server on. | |
# --root-path: Specifies a subpath to run the server on. | |