File size: 1,095 Bytes
0ddcb86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
services:
  db:
    image: postgres:16-alpine
    environment:
      POSTGRES_USER: rasta
      POSTGRES_PASSWORD: rasta
      POSTGRES_DB: rasta_ai
    ports:
      - "5432:5432"
    volumes:
      - rasta_pg_data:/var/lib/postgresql/data
      - ./init.sql:/docker-entrypoint-initdb.d/init.sql
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U rasta -d rasta_ai"]
      interval: 5s
      timeout: 3s
      retries: 10

  redis:
    image: redis:7-alpine
    ports:
      - "6379:6379"
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 5s
      timeout: 3s
      retries: 10

  api:
    build: .
    env_file:
      - .env
    environment:
      DATABASE_URL: postgresql+asyncpg://rasta:rasta@db:5432/rasta_ai
      SYNC_DATABASE_URL: postgresql+psycopg2://rasta:rasta@db:5432/rasta_ai
      REDIS_URL: redis://redis:6379/0
    ports:
      - "8000:8000"
    depends_on:
      db:
        condition: service_healthy
      redis:
        condition: service_healthy
    volumes:
      - ./app/models/artifacts:/app/app/models/artifacts

volumes:
  rasta_pg_data: