File size: 1,914 Bytes
046508a
 
 
 
 
 
 
 
 
 
 
c7be661
 
046508a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c7be661
046508a
 
c7be661
046508a
 
 
 
 
 
 
c7be661
046508a
 
8349858
046508a
8349858
 
 
 
 
 
c7be661
 
 
 
 
 
 
046508a
 
 
 
 
 
 
c7be661
 
 
 
 
 
 
 
 
046508a
 
 
 
 
 
c7be661
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
services:
  redis:
    image: redis:6-alpine
    container_name: job-app-redis
    ports:
      - "6379:6379"
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 5s
      timeout: 3s
      retries: 5
      start_period: 10s
    restart: unless-stopped
    networks:
      - job-app-network

  postgres:
    image: postgres:16-alpine
    container_name: job-app-postgres
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
      - POSTGRES_DB=postgres
    ports:
      - "5432:5432"
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 5s
      timeout: 5s
      retries: 5
      start_period: 10s
    volumes:
      - pg_data_local:/var/lib/postgresql/data
    restart: unless-stopped
    networks:
      - job-app-network

  agent:
    build:
      context: .
      dockerfile: Dockerfile
    image: job-app-workflow:latest  # Consider versioned tag in production
    container_name: job-app-agent
    ports:
      - "7860:7860"
    environment:
      - PORT=7860
      - LANGGRAPH_PORT=7860
      - REDIS_URI=redis://redis:6379
      - DATABASE_URI=postgresql://postgres:postgres@postgres:5432/postgres
    env_file:
      - .docker_env
    healthcheck:
      test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:7860/ok')"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s
    restart: unless-stopped
    depends_on:
      redis:
        condition: service_healthy
      postgres:
        condition: service_healthy
    networks:
      - job-app-network
    # Optional: Resource limits (uncomment for production)
    # deploy:
    #   resources:
    #     limits:
    #       cpus: '2'
    #       memory: 4G
    #     reservations:
    #       cpus: '1'
    #       memory: 2G

networks:
  job-app-network:
    driver: bridge

volumes:
  pg_data_local: