tfrere commited on
Commit
0f137f3
·
1 Parent(s): 7a62bb9
Files changed (2) hide show
  1. docker-compose.yml +0 -33
  2. frontend/server.js +2 -2
docker-compose.yml DELETED
@@ -1,33 +0,0 @@
1
- services:
2
- backend:
3
- build:
4
- context: ./backend
5
- dockerfile: Dockerfile.dev
6
- args:
7
- - HF_TOKEN=${HF_TOKEN}
8
- ports:
9
- - "${BACKEND_PORT:-8000}:8000"
10
- volumes:
11
- - ./backend:/app
12
- environment:
13
- - ENVIRONMENT=${ENVIRONMENT:-development}
14
- - HF_TOKEN=${HF_TOKEN}
15
- - HF_HOME=${HF_HOME:-/.cache}
16
- command: uvicorn app.asgi:app --host 0.0.0.0 --port 8000 --reload
17
-
18
- frontend:
19
- build:
20
- context: ./frontend
21
- dockerfile: Dockerfile.dev
22
- ports:
23
- - "${FRONTEND_PORT:-7860}:7860"
24
- volumes:
25
- - ./frontend:/app
26
- - /app/node_modules
27
- environment:
28
- - NODE_ENV=${ENVIRONMENT:-development}
29
- - CHOKIDAR_USEPOLLING=true
30
- - PORT=${FRONTEND_PORT:-7860}
31
- command: npm start
32
- stdin_open: true
33
- tty: true
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
frontend/server.js CHANGED
@@ -7,14 +7,14 @@ const { createProxyMiddleware } = require("http-proxy-middleware");
7
 
8
  const app = express();
9
  const port = process.env.PORT || 7860;
10
- const apiPort = process.env.INTERNAL_API_PORT || 8000;
11
 
12
  // Determine if we're in production (Hugging Face Spaces)
13
  const isProduction = process.env.NODE_ENV === "production";
14
 
15
  // Get the backend URL from environment or use localhost in development
16
  const backendUrl = isProduction
17
- ? "https://yourbench-yourbench-simple-demo.hf.space" // URL de production (same as frontend)
18
  : `http://127.0.0.1:${apiPort}`; // URL de développement
19
 
20
  // Enable CORS for all routes
 
7
 
8
  const app = express();
9
  const port = process.env.PORT || 7860;
10
+ const apiPort = process.env.INTERNAL_API_PORT || 7861;
11
 
12
  // Determine if we're in production (Hugging Face Spaces)
13
  const isProduction = process.env.NODE_ENV === "production";
14
 
15
  // Get the backend URL from environment or use localhost in development
16
  const backendUrl = isProduction
17
+ ? "https://yourbench-yourbench-simple-demo-backend.hf.space" // URL de production (backend space)
18
  : `http://127.0.0.1:${apiPort}`; // URL de développement
19
 
20
  // Enable CORS for all routes