File size: 1,226 Bytes
80dbe44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
version: '3.8'
services:
  
  # Backend FastAPI Service
  backend:
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "3454:3454"
    volumes:
      - .:/app
    environment:
      - PYTHONUNBUFFERED=1
      - API_BASE_URL=http://localhost:3454/api
    restart: unless-stopped
    command: ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "3454"]
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3454/"]
      interval: 30s
      timeout: 10s
      retries: 3

  # Frontend Gradio Service  
  frontend:
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "7860:7860"
    volumes:
      - .:/app
    environment:
      - PYTHONUNBUFFERED=1
      - API_BASE_URL=http://backend:3454/api
    restart: unless-stopped
    command: ["python", "app.py"]
    depends_on:
      - backend

  # All-in-one service (alternative)
  app:
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "3454:3454"
      - "7860:7860"
    volumes:
      - .:/app
    environment:
      - PYTHONUNBUFFERED=1
      - API_BASE_URL=http://localhost:3454/api
    restart: unless-stopped
    command: ["bash", "start.sh"]
    profiles:
      - "all-in-one"