fix: change default port
Port change to make it easier to deploy to spaces
This commit is contained in:
parent
a70eaaecfd
commit
19af1e1996
5 changed files with 10 additions and 12 deletions
|
|
@ -6,10 +6,10 @@ services:
|
||||||
context: ./
|
context: ./
|
||||||
dockerfile: ./dev.Dockerfile
|
dockerfile: ./dev.Dockerfile
|
||||||
ports:
|
ports:
|
||||||
- "5003:5003"
|
- "7860:7860"
|
||||||
volumes:
|
volumes:
|
||||||
- ./:/app
|
- ./:/app
|
||||||
command: bash -c "uvicorn langflow.main:app --host 0.0.0.0 --port 5003 --reload"
|
command: bash -c "uvicorn langflow.main:app --host 0.0.0.0 --port 7860 --reload"
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
build:
|
build:
|
||||||
|
|
@ -21,4 +21,6 @@ services:
|
||||||
- ./src/frontend:/app
|
- ./src/frontend:/app
|
||||||
# Set process.env.BACKEND to the backend service
|
# Set process.env.BACKEND to the backend service
|
||||||
environment:
|
environment:
|
||||||
- BACKEND="http://backend:5003"
|
- BACKEND_HOST="http://backend"
|
||||||
|
- BACKEND_PORT="7860"
|
||||||
|
restart: on-failure
|
||||||
|
|
|
||||||
|
|
@ -3,5 +3,5 @@ FROM python:3.11-slim
|
||||||
RUN apt-get update && apt-get install gcc -y
|
RUN apt-get update && apt-get install gcc -y
|
||||||
RUN pip install langflow>=0.0.33
|
RUN pip install langflow>=0.0.33
|
||||||
|
|
||||||
EXPOSE 5003
|
EXPOSE 7860
|
||||||
CMD ["langflow", "--host", "0.0.0.0"]
|
CMD ["langflow", "--host", "0.0.0.0"]
|
||||||
|
|
@ -14,11 +14,7 @@ def get_number_of_workers(workers=None):
|
||||||
return workers
|
return workers
|
||||||
|
|
||||||
|
|
||||||
def serve(
|
def serve(host: str = "127.0.0.1", workers: int = 1, timeout: int = 60):
|
||||||
host: str = "127.0.0.1",
|
|
||||||
workers: int = 1,
|
|
||||||
timeout: int = 60,
|
|
||||||
):
|
|
||||||
app = create_app()
|
app = create_app()
|
||||||
# get the directory of the current file
|
# get the directory of the current file
|
||||||
path = Path(__file__).parent
|
path = Path(__file__).parent
|
||||||
|
|
@ -28,7 +24,7 @@ def serve(
|
||||||
StaticFiles(directory=static_files_dir, html=True),
|
StaticFiles(directory=static_files_dir, html=True),
|
||||||
name="static",
|
name="static",
|
||||||
)
|
)
|
||||||
port = 5003
|
port = 7860
|
||||||
options = {
|
options = {
|
||||||
"bind": f"{host}:{port}",
|
"bind": f"{host}:{port}",
|
||||||
"workers": get_number_of_workers(workers),
|
"workers": get_number_of_workers(workers),
|
||||||
|
|
|
||||||
|
|
@ -33,4 +33,4 @@ app = create_app()
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import uvicorn
|
import uvicorn
|
||||||
|
|
||||||
uvicorn.run(app, host="127.0.0.1", port=5003)
|
uvicorn.run(app, host="127.0.0.1", port=7860)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { APIObjectType, sendAllProps } from '../../types/api/index';
|
import { APIObjectType, sendAllProps } from '../../types/api/index';
|
||||||
import axios, { AxiosResponse } from "axios";
|
import axios, { AxiosResponse } from "axios";
|
||||||
|
|
||||||
const backendUrl = process.env.BACKEND || "http://localhost:5003";
|
const backendUrl = process.env.BACKEND || "http://localhost:7860";
|
||||||
|
|
||||||
export async function getAll():Promise<AxiosResponse<APIObjectType>> {
|
export async function getAll():Promise<AxiosResponse<APIObjectType>> {
|
||||||
return await axios.get(`${backendUrl}/all`);
|
return await axios.get(`${backendUrl}/all`);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue