Fix procedure to deploy langflow on AWS (#1187)

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-12-10 11:49:47 -03:00 • committed by GitHub
commit 53f3d39f38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 11 deletions

View file

@ -17,4 +17,4 @@ RUN poetry config virtualenvs.create false && poetry install --no-interaction --
RUN poetry add pymysql==1.0.2 RUN poetry add pymysql==1.0.2
CMD ["uvicorn", "--factory", "src.backend.langflow.main:create_app", "--host", "0.0.0.0", "--port", "7860", "--reload", "--log-level", "debug"] CMD ["sh", "./container-cmd-cdk.sh"]

3
container-cmd-cdk.sh Normal file
View file

@ -0,0 +1,3 @@
export LANGFLOW_DATABASE_URL="mysql+pymysql://${username}:${password}@${host}:3306/${dbname}"
# echo $LANGFLOW_DATABASE_URL
uvicorn --factory src.backend.langflow.main:create_app --host 0.0.0.0 --port 7860 --reload --log-level debug

View file

@ -6,7 +6,7 @@ services:
backend: backend:
build: build:
context: ./ context: ./
dockerfile: ./cdk.Dockerfile dockerfile: ./dev.Dockerfile
env_file: env_file:
- .env - .env
ports: ports:

View file

@ -28,7 +28,7 @@ Fargate のタスクはフロントエンドとバックエンドに分かれて
1. 以下のコマンドを実行します。 1. 以下のコマンドを実行します。
```shell ```shell
git clone -b aws-cdk-dev2 https://github.com/kazuki306/langflow git clone -b aws-cdk https://github.com/logspace-ai/langflow.git
cd langflow/scripts/aws cd langflow/scripts/aws
cp .env.example .env # 環境設定を変える場合はこのファイル(.env)を編集してください。 cp .env.example .env # 環境設定を変える場合はこのファイル(.env)を編集してください。
npm ci npm ci

View file

@ -27,14 +27,14 @@ If you just want to deploy resources, you do not need in-depth knowledge of each
1. When you see `Done!` in Cloudshell, open `cloud9-for-prototyping` from [AWS Cloud9](https://us-east-1.console.aws.amazon.com/cloud9control/home?region=us-east-1#/). 1. When you see `Done!` in Cloudshell, open `cloud9-for-prototyping` from [AWS Cloud9](https://us-east-1.console.aws.amazon.com/cloud9control/home?region=us-east-1#/).
![make-cloud9](./img/langflow-cloud9-en.png) ![make-cloud9](./img/langflow-cloud9-en.png)
1. Run the following command in the Cloud9 terminal. 1. Run the following command in the Cloud9 terminal.
```shell ```shell
git clone -b aws-cdk-dev2 https://github.com/kazuki306/langflow git clone -b aws-cdk https://github.com/logspace-ai/langflow.git
cd langflow/scripts/aws cd langflow/scripts/aws
cp .env.example .env # Edit this file if you need environment settings cp .env.example .env # Edit this file if you need environment settings
npm ci npm ci
cdk bootstrap cdk bootstrap
cdk deploy cdk deploy
``` ```
1. Access the URL displayed. 1. Access the URL displayed.
```shell ```shell
Outputs: Outputs: