Spaces:
Sleeping
Sleeping
Gabriel Luiz Freitas Almeida
commited on
Update Dockerfile
Browse files- Dockerfile +13 -10
Dockerfile
CHANGED
|
@@ -1,29 +1,32 @@
|
|
| 1 |
FROM nikolaik/python-nodejs:python3.10-nodejs21
|
| 2 |
|
| 3 |
# Update and install required packages
|
| 4 |
-
RUN apt-get update && apt-get install gcc g++ git make pipx -
|
| 5 |
|
| 6 |
ENV LANGFLOW_HOME=/home/langflow \
|
| 7 |
PATH=/root/.local/bin:$PATH
|
| 8 |
ENV LANGFLOW_DATABASE_URL=sqlite:////home/langflow/langflow.db
|
| 9 |
|
| 10 |
-
# Clone the langflow repository and switch to the
|
| 11 |
ADD https://api.github.com/repos/logspace-ai/langflow/git/refs/heads/db version.json
|
| 12 |
RUN git clone https://github.com/logspace-ai/langflow.git $LANGFLOW_HOME \
|
| 13 |
&& cd $LANGFLOW_HOME \
|
| 14 |
&& git checkout zustand/io/migration && git pull
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
|
| 18 |
-
|
|
|
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
|
|
|
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
RUN
|
| 25 |
|
| 26 |
# Update the config.yaml file, build and install the langflow package
|
|
|
|
| 27 |
RUN make setup_poetry && make install_frontend && make build_frontend && make install_backend
|
| 28 |
|
| 29 |
-
CMD ["make", "start", "host=0.0.0.0", "port=7860", "log_level=debug", "open_browser=false"]
|
|
|
|
| 1 |
FROM nikolaik/python-nodejs:python3.10-nodejs21
|
| 2 |
|
| 3 |
# Update and install required packages
|
| 4 |
+
RUN apt-get update && apt-get install -y gcc g++ git make pipx && rm -rf /var/lib/apt/lists/*
|
| 5 |
|
| 6 |
ENV LANGFLOW_HOME=/home/langflow \
|
| 7 |
PATH=/root/.local/bin:$PATH
|
| 8 |
ENV LANGFLOW_DATABASE_URL=sqlite:////home/langflow/langflow.db
|
| 9 |
|
| 10 |
+
# Clone the langflow repository and switch to the relevant branch
|
| 11 |
ADD https://api.github.com/repos/logspace-ai/langflow/git/refs/heads/db version.json
|
| 12 |
RUN git clone https://github.com/logspace-ai/langflow.git $LANGFLOW_HOME \
|
| 13 |
&& cd $LANGFLOW_HOME \
|
| 14 |
&& git checkout zustand/io/migration && git pull
|
| 15 |
|
| 16 |
+
# Create a non-root user 'langflow' and grant ownership
|
| 17 |
+
RUN adduser --disabled-password --gecos '' langflow && chown -R langflow:langflow $LANGFLOW_HOME
|
| 18 |
+
|
| 19 |
+
USER langflow
|
| 20 |
|
| 21 |
+
# Copy the code into the container, now as the non-root user
|
| 22 |
+
WORKDIR $LANGFLOW_HOME
|
| 23 |
+
COPY --chown=langflow:langflow . .
|
| 24 |
|
| 25 |
+
# Create logs directory (as 'langflow' user)
|
| 26 |
+
RUN mkdir logs
|
| 27 |
|
| 28 |
# Update the config.yaml file, build and install the langflow package
|
| 29 |
+
# Make sure the non-root user has permissions to execute these operations
|
| 30 |
RUN make setup_poetry && make install_frontend && make build_frontend && make install_backend
|
| 31 |
|
| 32 |
+
CMD ["make", "start", "host=0.0.0.0", "port=7860", "log_level=debug", "open_browser=false"]
|