Spaces:
Sleeping

File size: 1,827 Bytes
1af9fb8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
59
60
61
62
63
64
65
# TFA Docker Compose Configuration
# For local development and testing

version: '3.8'

services:
  tfa-app:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: tfa-test-failure-analysis
    ports:
      - "7860:7860"  # HF Spaces port
      - "8501:8501"  # Alternative Streamlit port
    environment:
      # Application Configuration
      - TFA_ENVIRONMENT=development
      - TFA_USE_MOCK_DATA=true
      - TFA_LOG_LEVEL=INFO
      
      # Streamlit Configuration
      - STREAMLIT_SERVER_PORT=7860
      - STREAMLIT_SERVER_ADDRESS=0.0.0.0
      - STREAMLIT_SERVER_HEADLESS=true
      
      # Google API Key (override with your actual key)
      - GOOGLE_API_KEY=${GOOGLE_API_KEY:-demo-key-for-development}
      
      # Optional: Sponge API Configuration
      - SPONGE_API_ENDPOINT=${SPONGE_API_ENDPOINT:-}
      - SPONGE_BEARER_TOKEN=${SPONGE_BEARER_TOKEN:-}
    
    volumes:
      # Mount source code for development (optional)
      - ./tfa_agents:/home/tfa/tfa_agents:ro
      - ./tfa_ui:/home/tfa/tfa_ui:ro
      - ./docs:/home/tfa/docs:ro
    
    restart: unless-stopped
    
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:7860/_stcore/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 60s
    
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.tfa.rule=Host(`localhost`)"
      - "traefik.http.services.tfa.loadbalancer.server.port=7860"

  # Optional: Add a reverse proxy for production-like setup
  nginx:
    image: nginx:alpine
    container_name: tfa-nginx
    ports:
      - "80:80"
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    depends_on:
      - tfa-app
    restart: unless-stopped
    profiles:
      - production