This is an automated email from the ASF dual-hosted git repository. jin pushed a commit to branch dockerfile in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph-ai.git
commit bef03fe7d4467541368c84aabff3c5c6671994f3 Author: imbajin <j...@apache.org> AuthorDate: Fri Mar 7 17:32:35 2025 +0800 v1 change --- docker/Dockerfile.llm | 14 ++++++++++---- docker/charts/hg-llm/values.yaml | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile.llm b/docker/Dockerfile.llm index db919a8..39731e5 100644 --- a/docker/Dockerfile.llm +++ b/docker/Dockerfile.llm @@ -1,22 +1,28 @@ -# TODO: we could use 'uv' to replace the poetry + python image +# TODO: we could use 'uv' to replace the poetry + python image (Also use the slime image) FROM python:3.10.16-bookworm LABEL maintainer="HugeGraph Docker Maintainers <d...@hugegraph.apache.org>" -RUN pip install --no-cache-dir poetry +# Create non-root user & Install dependencies +RUN useradd -m -s /bin/bash work && \ + pip install --no-cache-dir poetry WORKDIR /home/work/ COPY --chown=work:work hugegraph-python-client/ ./hugegraph-python-client/ COPY --chown=work:work hugegraph-llm/ ./hugegraph-llm/ +USER work RUN cd /home/work/hugegraph-llm && \ poetry config virtualenvs.in-project true && \ poetry lock && \ - poetry install --no-interaction --no-ansi --verbose + poetry install --no-interaction --no-ansi --verbose && \ + rm -rf ~/.cache/pypoetry ENV PATH="/home/work/hugegraph-llm/.venv/bin:$PATH" WORKDIR /home/work/hugegraph-llm EXPOSE 8001 -CMD [ "python", "-m", "hugegraph_llm.demo.rag_demo.app", "--port", "8001" ] +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD curl -f http://localhost:8001/ || exit 1 + +CMD ["python", "-m", "hugegraph_llm.demo.rag_demo.app", "--host", "0.0.0.0", "--port", "8001"] diff --git a/docker/charts/hg-llm/values.yaml b/docker/charts/hg-llm/values.yaml index 4683454..600ee33 100644 --- a/docker/charts/hg-llm/values.yaml +++ b/docker/charts/hg-llm/values.yaml @@ -56,7 +56,7 @@ service: # This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports port: 8080 nodePort: 8039 - targetPort: 8080 + targetPort: 8001 # This block is for setting up the ingress for more information can be found here: https://kubernetes.io/docs/concepts/services-networking/ingress/ ingress: