feat: adding docker.compose
This commit is contained in:
parent
7224ed0761
commit
9d45ab3e49
3 changed files with 47 additions and 10 deletions
17
Dockerfile
17
Dockerfile
|
|
@ -1,4 +1,4 @@
|
|||
FROM logspace/backend_build as backend_build
|
||||
# FROM logspace/backend_build as backend_build
|
||||
FROM logspace/frontend_build as frontend_build
|
||||
|
||||
# `python-base` sets up all our shared environment variables
|
||||
|
|
@ -41,29 +41,26 @@ RUN apt-get update \
|
|||
build-essential libpq-dev git
|
||||
|
||||
# install poetry - respects $POETRY_VERSION & $POETRY_HOME
|
||||
RUN curl -sSL https://install.python-poetry.org | python3 -
|
||||
# RUN curl -sSL https://install.python-poetry.org | python3 -
|
||||
|
||||
# copy project requirement files here to ensure they will be cached.
|
||||
WORKDIR /app
|
||||
COPY pyproject.toml ./
|
||||
#poetry.lock
|
||||
# copy langflow
|
||||
COPY ./langflow ./langflow
|
||||
|
||||
# Copy files from frontend
|
||||
COPY --from=frontend_build /app/build /app/langflow/frontend/build/
|
||||
|
||||
# Copy files from backend and install
|
||||
COPY --from=backend_build /app/dist/*.whl /app/dist/
|
||||
|
||||
# Copy cli.py
|
||||
COPY langflow/cli.py /app/langflow/
|
||||
|
||||
# RUN pip install langflow-0.0.17-py3-none-any.whl
|
||||
RUN poetry install
|
||||
RUN pip install .
|
||||
# RUN poetry add dist/langflow-0.0.17-py3-none-any.whl
|
||||
# RUN rm *.whl
|
||||
|
||||
# RUN poetry build
|
||||
|
||||
# EXPOSE 80
|
||||
EXPOSE 5003
|
||||
|
||||
# CMD [ "langchain" ]
|
||||
CMD [ "langflow" ]
|
||||
|
|
|
|||
20
dev.Dockerfile
Normal file
20
dev.Dockerfile
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.10
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install Poetry
|
||||
RUN apt-get update && apt-get install -y curl
|
||||
RUN curl -sSL https://install.python-poetry.org | python3 -
|
||||
# Add Poetry to PATH
|
||||
ENV PATH="${PATH}:/root/.local/bin"
|
||||
# Copy the pyproject.toml and poetry.lock files
|
||||
COPY poetry.lock pyproject.toml ./
|
||||
# Copy the rest of the application codes
|
||||
COPY ./ ./
|
||||
|
||||
|
||||
# install dependencies
|
||||
RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi
|
||||
|
||||
|
||||
CMD ["uvicorn", "langflow.cli:app", "--host", "0.0.0.0", "--port", "5003"]
|
||||
20
docker-compose.yml
Normal file
20
docker-compose.yml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
version: '3'
|
||||
|
||||
services:
|
||||
backend:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: ./dev.Dockerfile
|
||||
ports:
|
||||
- "5003:5003"
|
||||
volumes:
|
||||
- ./:/app
|
||||
environment:
|
||||
- PYTHONPATH=/langflow # add this line to set PYTHONPATH
|
||||
|
||||
frontend:
|
||||
build: ./langflow/frontend
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- ./langflow/frontend:/app
|
||||
Loading…
Add table
Add a link
Reference in a new issue