File size: 1,106 Bytes
44cdbab
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
version: '3.8'

services:
  backend:
    build:
      context: ./backend
      dockerfile: Dockerfile
    container_name: land-redistribution-api
    ports:
      - "8000:7860"
    environment:
      - API_HOST=0.0.0.0
      - API_PORT=7860
      - CORS_ORIGINS=*
      - LOG_LEVEL=INFO
    healthcheck:
      test: [ "CMD", "python", "-c", "import requests; requests.get('http://localhost:7860/health')" ]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s
    restart: unless-stopped
    networks:
      - app-network

  frontend:
    image: python:3.11-slim
    container_name: land-redistribution-ui
    working_dir: /app
    ports:
      - "8501:8501"
    environment:
      - API_URL=http://backend:7860
    volumes:
      - ./frontend:/app
    command: >
      sh -c "pip install --no-cache-dir -r requirements.txt &&
             streamlit run app.py --server.port 8501 --server.address 0.0.0.0"
    depends_on:
      backend:
        condition: service_healthy
    restart: unless-stopped
    networks:
      - app-network

networks:
  app-network:
    driver: bridge