File size: 1,302 Bytes
de1a882
3ac3fbf
4fb5f9f
b37b58e
e4ab603
8f5d5fe
 
111ef26
5db1ab6
b37b58e
9f426c7
39f15c9
8f5d5fe
5dc3284
5ec2854
b37b58e
 
 
 
8e6706d
b37b58e
 
 
6000f56
b37b58e
 
c1ddee0
4fb5f9f
b37b58e
9da8c84
e4ab603
b37b58e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM nikolaik/python-nodejs:python3.10-nodejs21

# Update and install required packages
RUN apt-get update && apt-get install -y gcc g++ git make pipx && rm -rf /var/lib/apt/lists/*

ENV LANGFLOW_HOME=/home/langflow \
    PATH=/root/.local/bin:$PATH
ENV LANGFLOW_DATABASE_URL=sqlite:////home/langflow/langflow.db

# Clone the langflow repository and switch to the relevant branch
ADD https://api.github.com/repos/logspace-ai/langflow/git/refs/heads/db version.json
RUN git clone https://github.com/logspace-ai/langflow.git $LANGFLOW_HOME \
    && cd $LANGFLOW_HOME \
    && git checkout zustand/io/migration && git pull

# Create a non-root user 'langflow' and grant ownership
RUN adduser --disabled-password --gecos '' langflow && chown -R langflow:langflow $LANGFLOW_HOME

USER langflow

# Copy the code into the container, now as the non-root user
WORKDIR $LANGFLOW_HOME
COPY --chown=langflow:langflow . .

# Create logs directory (as 'langflow' user)
RUN mkdir logs

# Update the config.yaml file, build and install the langflow package
# Make sure the non-root user has permissions to execute these operations
RUN make setup_poetry && make install_frontend && make build_frontend && make install_backend

CMD ["make", "start", "host=0.0.0.0", "port=7860", "log_level=debug", "open_browser=false"]