🔧 chore(main.tf): add installation of git and docker-compose to improve deployment process

 feat(main.tf): add cloning of langflow repository and checkout to celery branch for specific project requirements
This commit is contained in:
Matheus Jacques 2023-08-28 23:42:24 +02:00
commit d4ecb9896d
8 changed files with 42 additions and 45 deletions

View file

@ -4,3 +4,38 @@ STACK_NAME=langflow-stack
TRAEFIK_PUBLIC_NETWORK=traefik-public
TRAEFIK_TAG=langflow-traefik
TRAEFIK_PUBLIC_TAG=traefik-public
# Database configuration
DB_USER=langflow
DB_PASSWORD=langflow
DB_HOST=db
DB_PORT=5432
DB_NAME=langflow
# Logging configuration
LOG_LEVEL=debug
# DB configuration
POSTGRES_USER=langflow
POSTGRES_PASSWORD=langflow
POSTGRES_DB=langflow
# Flower configuration
LANGFLOW_CACHE_TYPE=redis
LANGFLOW_REDIS_HOST=queue
LANGFLOW_REDIS_PORT=6379
LANGFLOW_REDIS_DB=0
LANGFLOW_REDIS_EXPIRE=3600
LANGFLOW_REDIS_PASSWORD=
FLOWER_UNAUTHENTICATED_API=True
BROKER_URL=redis://queue:6379/0
RESULT_BACKEND=redis://queue:6379/0
C_FORCE_ROOT="true # ! Only for development"
# Frontend configuration
VITE_PROXY_TARGET=http://backend:7860/api/
BACKEND_URL=http://backend:7860
# PGAdmin configuration
PGADMIN_DEFAULT_EMAIL=admin@admin.com
PGADMIN_DEFAULT_PASSWORD=admin

View file

@ -1,18 +0,0 @@
# Database configuration
DB_USER=langflow
DB_PASSWORD=langflow
DB_HOST=db
DB_PORT=5432
DB_NAME=langflow
# Logging configuration
LOG_LEVEL=debug
# Cache configuration
LANGFLOW_CACHE_TYPE=redis
# Redis configuration
LANGFLOW_REDIS_HOST=queue
LANGFLOW_REDIS_PORT=6379
LANGFLOW_REDIS_DB=0
LANGFLOW_REDIS_EXPIRE=3600

View file

@ -1,8 +0,0 @@
LANGFLOW_CACHE_TYPE=redis
LANGFLOW_REDIS_HOST=queue
LANGFLOW_REDIS_PORT=6379
LANGFLOW_REDIS_DB=0
LANGFLOW_REDIS_EXPIRE=3600
BROKER_URL=redis://queue:6379/0
RESULT_BACKEND=redis://queue:6379/0
C_FORCE_ROOT="true # ! Only for development"

View file

@ -1,3 +0,0 @@
POSTGRES_USER=langflow
POSTGRES_PASSWORD=langflow
POSTGRES_DB=langflow

View file

@ -1,10 +0,0 @@
LANGFLOW_CACHE_TYPE=redis
LANGFLOW_REDIS_HOST=queue
LANGFLOW_REDIS_PORT=6379
LANGFLOW_REDIS_DB=0
LANGFLOW_REDIS_EXPIRE=3600
LANGFLOW_REDIS_PASSWORD=
FLOWER_UNAUTHENTICATED_API=True
BROKER_URL=redis://queue:6379/0
RESULT_BACKEND=redis://queue:6379/0
C_FORCE_ROOT="true # ! Only for development"

View file

@ -1,3 +0,0 @@
VITE_PROXY_TARGET=http://backend:7860/api/
BACKEND_URL=http://backend:7860

View file

@ -1,2 +0,0 @@
PGADMIN_DEFAULT_EMAIL=admin@admin.com
PGADMIN_DEFAULT_PASSWORD=admin

View file

@ -20,7 +20,10 @@ resource "aws_instance" "manager" {
#!/bin/bash
sudo yum update -y
sudo yum install -y docker
sudo yum install -y git
sudo yum install -y nc
sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo service docker start
sudo usermod -a -G docker ec2-user
sudo chkconfig docker on
@ -34,7 +37,10 @@ resource "aws_instance" "manager" {
# Create a script to get the join token
echo 'docker swarm join-token worker -q' > get_token.sh
chmod +x get_token.sh
while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; ./get_token.sh; } | nc -l 8080; done &
timeout 5m bash -c "while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; ./get_token.sh; } | nc -l 8080; done" &
git clone https://github.com/logspace-ai/langflow.git
git checkout celery
EOT