Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
italojohnny committed Aug 23, 2024
1 parent 2eca4d9 commit c84decb
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 13 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,11 @@ docker_compose_down:
@echo 'Running docker compose down'
docker compose -f $(DOCKER_COMPOSE) down || true

dcdev_up:
@echo 'Running docker compose up'
docker compose -f docker/dev.docker-compose.yml down || true
docker compose -f docker/dev.docker-compose.yml up --remove-orphans

lock_base:
cd src/backend/base && poetry lock

Expand Down
31 changes: 18 additions & 13 deletions docker/dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
FROM python:3.10-slim
FROM python:3.12-bookworm
ENV TZ=UTC

WORKDIR /app

# Install Poetry
RUN apt-get update && apt-get install gcc g++ curl build-essential postgresql-server-dev-all -y
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 ./ ./
RUN apt update -y
RUN apt install \
build-essential \
postgresql-server-dev-all \
curl \
npm \
-y

# Install dependencies
RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi
COPY . /app

CMD ["uvicorn", "--factory", "langflow.main:create_app", "--host", "0.0.0.0", "--port", "7860", "--reload", "--log-level", "debug", "--loop", "asyncio"]
RUN pip install poetry psycopg2-binary
RUN poetry config virtualenvs.create false
RUN poetry install --no-interaction --no-ansi

EXPOSE 7860
EXPOSE 3000

CMD ["./docker/dev.start.sh"]
42 changes: 42 additions & 0 deletions docker/dev.docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
networks:
dev-langflow:

services:
langflow:
build:
context: ..
dockerfile: docker/dev.Dockerfile
image: dev-langflow
container_name: dev-langflow
restart: always
ports:
- "7860:7860"
- "3000:3000"
environment:
- PYTHONDONTWRITEBYTECODE=1
- LANGFLOW_DATABASE_URL=postgresql://langflow:langflow@postgres:5432/langflow
- LANGFLOW_SUPERUSER=langflow
- LANGFLOW_SUPERUSER_PASSWORD=langflow
- LANGFLOW_CONFIG_DIR=/var/lib/langflow
env_file:
- ../.env
volumes:
- ../:/app
depends_on:
- postgres # Dependência no seu banco de dados existente
networks:
- dev-langflow


postgres:
container_name: postgres
image: pgvector/pgvector:pg16
environment:
POSTGRES_USER: langflow
POSTGRES_PASSWORD: langflow
POSTGRES_DB: langflow
ports:
- "5432:5432"
networks:
- dev-langflow

4 changes: 4 additions & 0 deletions docker/dev.start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

cd src/frontend && npm run dev:docker &
make backend

0 comments on commit c84decb

Please sign in to comment.