File size: 1,500 Bytes
18935fc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
version: '3.8'

services:
  # GreenPath Streamlit Frontend
  streamlit:
    build: 
      context: .
      dockerfile: Dockerfile.streamlit
    ports:
      - "8501:8501"
    environment:
      - DATABASE_URL=sqlite:///app/greenpath.db
      - OPENROUTESERVICE_API_KEY=${OPENROUTESERVICE_API_KEY}
      - FASTAPI_URL=http://fastapi:8000
    volumes:
      - ./data:/app/data
      - ./greenpath.db:/app/greenpath.db
    depends_on:
      - fastapi
    restart: unless-stopped
    
  # GreenPath FastAPI Backend
  fastapi:
    build:
      context: .
      dockerfile: Dockerfile.fastapi
    ports:
      - "8000:8000"
    environment:
      - DATABASE_URL=sqlite:///app/greenpath.db
      - OPENROUTESERVICE_API_KEY=${OPENROUTESERVICE_API_KEY}
    volumes:
      - ./data:/app/data
      - ./greenpath.db:/app/greenpath.db
    restart: unless-stopped

  # PostgreSQL Database (Optional - for production)
  postgres:
    image: postgres:13
    environment:
      - POSTGRES_DB=greenpath
      - POSTGRES_USER=greenpath_user
      - POSTGRES_PASSWORD=secure_greenpath_password
    volumes:
      - postgres_data:/var/lib/postgresql/data
    ports:
      - "5432:5432"
    restart: unless-stopped
  # Redis for caching (optional)
  redis:
    image: redis:7-alpine
    ports:
      - "6379:6379"
    restart: unless-stopped
    networks:
      - shipment_network

volumes:
  postgres_data:

networks:
  shipment_network:
    driver: bridge