Merge pull request #20 from langflow-ai/langflow-dockerfile
This commit is contained in:
commit
8c142f89b7
1 changed files with 49 additions and 0 deletions
49
Dockerfile.langflow
Normal file
49
Dockerfile.langflow
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
FROM python:3.12-slim
|
||||
|
||||
# Set environment variables
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV RUSTFLAGS="--cfg reqwest_unstable"
|
||||
|
||||
# Accept build arguments for git repository and branch
|
||||
ARG GIT_REPO=https://github.com/langflow-ai/langflow.git
|
||||
ARG GIT_BRANCH=load_flows_autologin_false
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
build-essential \
|
||||
curl \
|
||||
git \
|
||||
ca-certificates \
|
||||
gnupg \
|
||||
npm \
|
||||
rustc cargo pkg-config libssl-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install uv for faster Python package management
|
||||
RUN pip install uv
|
||||
|
||||
# Clone the repository and checkout the specified branch
|
||||
RUN git clone --depth 1 --branch ${GIT_BRANCH} ${GIT_REPO} /app
|
||||
|
||||
# Install backend dependencies
|
||||
RUN uv sync --frozen --no-install-project --no-editable --extra postgresql
|
||||
|
||||
# Build frontend
|
||||
WORKDIR /app/src/frontend
|
||||
RUN npm ci && \
|
||||
npm run build && \
|
||||
mkdir -p /app/src/backend/base/langflow/frontend && \
|
||||
cp -r build/* /app/src/backend/base/langflow/frontend/
|
||||
|
||||
# Return to app directory and install the project
|
||||
WORKDIR /app
|
||||
RUN uv sync --frozen --no-dev --no-editable --extra postgresql
|
||||
|
||||
# Expose ports
|
||||
EXPOSE 7860
|
||||
|
||||
# Start the backend server
|
||||
CMD ["uv", "run", "langflow", "run", "--host", "0.0.0.0", "--port", "7860"]
|
||||
Loading…
Add table
Reference in a new issue