Skip to content

The agent engineering platform.

Add docker compose to CLI (#11406)

Eugene Yurtsev5a1f61417563
diff --git a/libs/langchain/langchain/cli/create_repo/templates/repo/.env b/libs/langchain/langchain/cli/create_repo/templates/repo/.env
new file mode 100644
index 0000000000..173a5f3dd9
--- /dev/null
+++ b/libs/langchain/langchain/cli/create_repo/templates/repo/.env
@@ -0,0 +1,2 @@
+PORT=8001
+OPENAI_API_KEY="your_secret_key_here"
diff --git a/libs/langchain/langchain/cli/create_repo/templates/repo/README.md b/libs/langchain/langchain/cli/create_repo/templates/repo/README.md
index c624c5a0d5..3b3454692b 100644
--- a/libs/langchain/langchain/cli/create_repo/templates/repo/README.md
+++ b/libs/langchain/langchain/cli/create_repo/templates/repo/README.md
@@ -35,6 +35,12 @@ make start
This will launch a webserver on port 8001.
+Or via docker compose (does not use hot reload by default):
+
+```
+docker compose up
+```
+
## Deploy
To deploy the project, first build the docker image:
diff --git a/libs/langchain/langchain/cli/create_repo/templates/repo/docker-compose.yml b/libs/langchain/langchain/cli/create_repo/templates/repo/docker-compose.yml
new file mode 100644
index 0000000000..ac695f025e
--- /dev/null
+++ b/libs/langchain/langchain/cli/create_repo/templates/repo/docker-compose.yml
@@ -0,0 +1,12 @@
+version: '3'
+
+services:
+ server:
+ build:
+ context: .
+ image: ____project_name:latest
+ container_name: ____project_name
+ ports:
+ - "8001:8001"
+ env_file:
+ - .env