Skip to content

Commit

Permalink
buid: reduce number of layers in runtime env for langflow-ep build (l…
Browse files Browse the repository at this point in the history
…angflow-ai#4457)

Reduce number of layers in runtime env
  • Loading branch information
jordanrfrazier authored Nov 7, 2024
1 parent 18d0841 commit 3a1c030
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions docker/build_and_push_ep.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ RUN --mount=type=cache,target=/root/.cache/uv \
################################
FROM python:3.12.3-slim AS runtime

RUN useradd user -u 1000 -g 0 --no-create-home --home-dir /app/data
RUN useradd user -u 1000 -g 0 --no-create-home --home-dir /app/data && \
mkdir /data && chown -R 1000:0 /data

COPY --from=builder --chown=1000 /app/.venv /app/.venv

# curl is required for langflow health checks
Expand All @@ -79,16 +81,10 @@ LABEL org.opencontainers.image.licenses=MIT
LABEL org.opencontainers.image.url=https://github.com/langflow-ai/langflow
LABEL org.opencontainers.image.source=https://github.com/langflow-ai/langflow

RUN useradd ragstack -u 10000 -g 0 --no-create-home --home-dir /app/data
WORKDIR /app

RUN mkdir /data
RUN chown -R 10000:0 /data
RUN chown -R 10000:0 /app

ENV LANGFLOW_HOST=0.0.0.0
ENV LANGFLOW_PORT=7860

USER 10000

ENTRYPOINT ["python", "-m", "langflow", "run", "--host", "0.0.0.0", "--backend-only"]
USER 1000
ENTRYPOINT ["python", "-m", "langflow", "run", "--host", "0.0.0.0", "--backend-only"]

0 comments on commit 3a1c030

Please sign in to comment.