Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infra/fix sdk compose #278

Merged
merged 3 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion js/src/cli/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ version: "3"
services:
langchain-playground:
image: langchain/${_LANGSMITH_IMAGE_PREFIX-}langchainplus-playground:latest
ports:
- 3001:3001
langchain-frontend:
image: langchain/${_LANGSMITH_IMAGE_PREFIX-}langchainplus-frontend:latest
image: langchain/${_LANGSMITH_IMAGE_PREFIX-}langchainplus-frontend-dynamic:latest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is frontend-dynamic the preferred frontend image now? People will likely not want to change the backend url when running with compose

ports:
- 80:80
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf
depends_on:
- langchain-backend
- langchain-playground
- langchain-hub
langchain-backend:
image: langchain/${_LANGSMITH_IMAGE_PREFIX-}langchainplus-backend:latest
environment:
Expand Down
60 changes: 60 additions & 0 deletions js/src/cli/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
server {
listen 80;
server_name localhost;

add_header Content-Security-Policy "frame-ancestors 'self'" always;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

location ~ /api/playground/ {
rewrite /api/playground/(.*) /$1 break;
chunked_transfer_encoding off;
proxy_set_header Connection '';
proxy_http_version 1.1;
proxy_buffering off;
proxy_cache off;
proxy_pass http://langchain-playground:3001;
}

location = /api/playground {
rewrite /api/playground(.*) $1 break;
chunked_transfer_encoding off;
proxy_set_header Connection '';
proxy_http_version 1.1;
proxy_buffering off;
proxy_cache off;
proxy_pass http://langchain-playground:3001;
}

# Hub Routes
location ~ /api-hub {
rewrite /api-hub/(.*) /$1 break;
chunked_transfer_encoding off;
proxy_set_header Connection '';
proxy_http_version 1.1;
proxy_buffering off;
proxy_cache off;
proxy_pass http://langchain-hub:1985;
}

# Backend Routes
location ~ /api {
rewrite /api/(.*) /$1 break;
chunked_transfer_encoding off;
proxy_set_header Connection '';
proxy_http_version 1.1;
proxy_buffering off;
proxy_cache off;
proxy_pass http://langchain-backend:1984;
}

}
7 changes: 6 additions & 1 deletion python/langsmith/cli/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ version: "3"
services:
langchain-playground:
image: langchain/${_LANGSMITH_IMAGE_PREFIX-}langchainplus-playground:latest
ports:
- 3001:3001
langchain-frontend:
image: langchain/${_LANGSMITH_IMAGE_PREFIX-}langchainplus-frontend:latest
image: langchain/${_LANGSMITH_IMAGE_PREFIX-}langchainplus-frontend-dynamic:latest
ports:
- 80:80
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf
depends_on:
- langchain-backend
- langchain-playground
- langchain-hub
langchain-backend:
image: langchain/${_LANGSMITH_IMAGE_PREFIX-}langchainplus-backend:latest
environment:
Expand Down
60 changes: 60 additions & 0 deletions python/langsmith/cli/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
server {
listen 80;
server_name localhost;

add_header Content-Security-Policy "frame-ancestors 'self'" always;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

location ~ /api/playground/ {
rewrite /api/playground/(.*) /$1 break;
chunked_transfer_encoding off;
proxy_set_header Connection '';
proxy_http_version 1.1;
proxy_buffering off;
proxy_cache off;
proxy_pass http://langchain-playground:3001;
}

location = /api/playground {
rewrite /api/playground(.*) $1 break;
chunked_transfer_encoding off;
proxy_set_header Connection '';
proxy_http_version 1.1;
proxy_buffering off;
proxy_cache off;
proxy_pass http://langchain-playground:3001;
}

# Hub Routes
location ~ /api-hub {
rewrite /api-hub/(.*) /$1 break;
chunked_transfer_encoding off;
proxy_set_header Connection '';
proxy_http_version 1.1;
proxy_buffering off;
proxy_cache off;
proxy_pass http://langchain-hub:1985;
}

# Backend Routes
location ~ /api {
rewrite /api/(.*) /$1 break;
chunked_transfer_encoding off;
proxy_set_header Connection '';
proxy_http_version 1.1;
proxy_buffering off;
proxy_cache off;
proxy_pass http://langchain-backend:1984;
}

}
Loading