diff --git a/cdk.Dockerfile b/cdk.Dockerfile new file mode 100644 index 000000000..44ccf0acb --- /dev/null +++ b/cdk.Dockerfile @@ -0,0 +1,20 @@ +FROM --platform=linux/amd64 python:3.10-slim + +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 ./ ./ + +# Install dependencies +RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi + +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"] diff --git a/dev.Dockerfile b/dev.Dockerfile index ce5715e1f..ed3631516 100644 --- a/dev.Dockerfile +++ b/dev.Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=linux/amd64 python:3.10-slim +FROM python:3.10-slim WORKDIR /app diff --git a/scripts/cdk/.env.example b/scripts/aws/.env.example similarity index 100% rename from scripts/cdk/.env.example rename to scripts/aws/.env.example diff --git a/scripts/cdk/.gitignore b/scripts/aws/.gitignore similarity index 100% rename from scripts/cdk/.gitignore rename to scripts/aws/.gitignore diff --git a/scripts/cdk/.npmignore b/scripts/aws/.npmignore similarity index 100% rename from scripts/cdk/.npmignore rename to scripts/aws/.npmignore diff --git a/scripts/cdk/README.md b/scripts/aws/README.md similarity index 100% rename from scripts/cdk/README.md rename to scripts/aws/README.md diff --git a/scripts/cdk/bin/cdk.ts b/scripts/aws/bin/cdk.ts similarity index 100% rename from scripts/cdk/bin/cdk.ts rename to scripts/aws/bin/cdk.ts diff --git a/scripts/cdk/cdk.json b/scripts/aws/cdk.json similarity index 100% rename from scripts/cdk/cdk.json rename to scripts/aws/cdk.json diff --git a/scripts/cdk/delete-docker-images.sh b/scripts/aws/delete-docker-images.sh similarity index 100% rename from scripts/cdk/delete-docker-images.sh rename to scripts/aws/delete-docker-images.sh diff --git a/scripts/cdk/delete-ecr.sh b/scripts/aws/delete-ecr.sh similarity index 100% rename from scripts/cdk/delete-ecr.sh rename to scripts/aws/delete-ecr.sh diff --git a/scripts/cdk/jest.config.js b/scripts/aws/jest.config.js similarity index 100% rename from scripts/cdk/jest.config.js rename to scripts/aws/jest.config.js diff --git a/scripts/cdk/lib/cdk-stack.ts b/scripts/aws/lib/cdk-stack.ts similarity index 100% rename from scripts/cdk/lib/cdk-stack.ts rename to scripts/aws/lib/cdk-stack.ts diff --git a/scripts/cdk/lib/construct/backend.ts b/scripts/aws/lib/construct/backend.ts similarity index 100% rename from scripts/cdk/lib/construct/backend.ts rename to scripts/aws/lib/construct/backend.ts diff --git a/scripts/cdk/lib/construct/db.ts b/scripts/aws/lib/construct/db.ts similarity index 100% rename from scripts/cdk/lib/construct/db.ts rename to scripts/aws/lib/construct/db.ts diff --git a/scripts/cdk/lib/construct/ecr.ts b/scripts/aws/lib/construct/ecr.ts similarity index 100% rename from scripts/cdk/lib/construct/ecr.ts rename to scripts/aws/lib/construct/ecr.ts diff --git a/scripts/cdk/lib/construct/frontend.ts b/scripts/aws/lib/construct/frontend.ts similarity index 100% rename from scripts/cdk/lib/construct/frontend.ts rename to scripts/aws/lib/construct/frontend.ts diff --git a/scripts/cdk/lib/construct/iam.ts b/scripts/aws/lib/construct/iam.ts similarity index 100% rename from scripts/cdk/lib/construct/iam.ts rename to scripts/aws/lib/construct/iam.ts diff --git a/scripts/cdk/lib/construct/index.ts b/scripts/aws/lib/construct/index.ts similarity index 100% rename from scripts/cdk/lib/construct/index.ts rename to scripts/aws/lib/construct/index.ts diff --git a/scripts/cdk/lib/construct/network.ts b/scripts/aws/lib/construct/network.ts similarity index 100% rename from scripts/cdk/lib/construct/network.ts rename to scripts/aws/lib/construct/network.ts diff --git a/scripts/cdk/package-lock.json b/scripts/aws/package-lock.json similarity index 100% rename from scripts/cdk/package-lock.json rename to scripts/aws/package-lock.json diff --git a/scripts/cdk/package.json b/scripts/aws/package.json similarity index 100% rename from scripts/cdk/package.json rename to scripts/aws/package.json diff --git a/scripts/cdk/test/cdk.test.ts b/scripts/aws/test/cdk.test.ts similarity index 100% rename from scripts/cdk/test/cdk.test.ts rename to scripts/aws/test/cdk.test.ts diff --git a/src/frontend/cdk.Dockerfile b/src/frontend/cdk.Dockerfile new file mode 100644 index 000000000..0b33e09b8 --- /dev/null +++ b/src/frontend/cdk.Dockerfile @@ -0,0 +1,26 @@ +#baseline +FROM --platform=linux/amd64 node:19-bullseye-slim AS base +RUN mkdir -p /home/node/app +RUN chown -R node:node /home/node && chmod -R 770 /home/node +RUN apt-get update && apt-get install -y jq curl +WORKDIR /home/node/app + +# client build +FROM base AS builder-client +ARG BACKEND_URL +ENV BACKEND_URL $BACKEND_URL +RUN echo "BACKEND_URL: $BACKEND_URL" + +WORKDIR /home/node/app +COPY --chown=node:node . ./ + +COPY ./set_proxy.sh . +RUN chmod +x set_proxy.sh && \ + cat set_proxy.sh | tr -d '\r' > set_proxy_unix.sh && \ + chmod +x set_proxy_unix.sh && \ + ./set_proxy_unix.sh + +USER node + +RUN npm install --loglevel warn +CMD ["npm", "run", "dev:docker"] \ No newline at end of file diff --git a/src/frontend/dev.Dockerfile b/src/frontend/dev.Dockerfile index 0b33e09b8..8678b02dd 100644 --- a/src/frontend/dev.Dockerfile +++ b/src/frontend/dev.Dockerfile @@ -1,8 +1,8 @@ #baseline -FROM --platform=linux/amd64 node:19-bullseye-slim AS base +FROM node:19-bullseye-slim AS base RUN mkdir -p /home/node/app RUN chown -R node:node /home/node && chmod -R 770 /home/node -RUN apt-get update && apt-get install -y jq curl +RUN apt-get update && apt-get install -y jq WORKDIR /home/node/app # client build