summaryrefslogtreecommitdiff
path: root/docker-compose.yml
blob: 9e74612263e2d25159b7745bce1307df741f8053 (plain)
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
services:
  postgres:
    image: postgres:16-alpine
    environment:
      POSTGRES_USER: aigw
      POSTGRES_PASSWORD: aigw
      POSTGRES_DB: aigw
    ports:
      - "127.0.0.1:5432:5432"
    volumes:
      - aigw-postgres:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U aigw -d aigw"]
      interval: 5s
      timeout: 3s
      retries: 20

  redis:
    image: redis:7-alpine
    ports:
      - "127.0.0.1:6379:6379"
    volumes:
      - aigw-redis:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 5s
      timeout: 3s
      retries: 20

  aigw:
    build: .
    depends_on:
      postgres:
        condition: service_healthy
    ports:
      - "127.0.0.1:8080:8080"
    environment:
      AIGW_DATABASE_URL: postgres://aigw:aigw@postgres:5432/aigw?sslmode=disable
      AIGW_REDIS_URL: redis://redis:6379/0
      AIGW_CREDENTIAL_KEY: ${AIGW_CREDENTIAL_KEY:?set AIGW_CREDENTIAL_KEY}
      AIGW_ADMIN_TOKEN: ${AIGW_ADMIN_TOKEN:?set AIGW_ADMIN_TOKEN}
    volumes:
      - ./config.control.example.json:/etc/aigw/config.json:ro

volumes:
  aigw-postgres:
  aigw-redis: