Update Dockerfiles to create langflow directory and grant write permissions (#1996)

This pull request updates the Dockerfiles to create a "langflow" directory and grant write permissions to it. This change ensures that the user inside the Docker container has the necessary permissions to write to the "langflow" directory.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-05-28 12:01:20 -07:00 committed by GitHub
commit 3f5769dd79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 6 deletions

View file

@ -77,11 +77,13 @@ RUN $POETRY_HOME/bin/poetry lock
RUN $POETRY_HOME/bin/poetry build
# Copy virtual environment and built .tar.gz from builder base
RUN useradd -m -u 1000 user
RUN chown -R user:user /app
RUN useradd -m -u 1000 user && \
mkdir -p /app/langflow && \
chown -R user:user /app \
chmod -R u+w /app/langflow
USER user
# Install the package from the .tar.gz
RUN python -m pip install /app/dist/*.tar.gz
RUN python -m pip install /app/dist/*.tar.gz --user
ENTRYPOINT ["python", "-m", "langflow", "run"]
CMD ["--host", "0.0.0.0", "--port", "7860"]

View file

@ -81,11 +81,14 @@ RUN rm -rf src/backend/base/dist
RUN cd src/backend/base && $POETRY_HOME/bin/poetry build
# Copy virtual environment and built .tar.gz from builder base
RUN useradd -m -u 1000 user
RUN chown -R user:user /app
RUN useradd -m -u 1000 user && \
mkdir -p /app/langflow && \
chown -R user:user /app \
chmod -R u+w /app/langflow
USER user
# Install the package from the .tar.gz
RUN python -m pip install /app/src/backend/base/dist/*.tar.gz
RUN python -m pip install /app/src/backend/base/dist/*.tar.gz --user
ENTRYPOINT ["python", "-m", "langflow", "run"]