version: '3'

services:
  siren:
    image: siren:${SIREN_VERSION:-latest}
    container_name: siren
    build:
      context: .
      dockerfile: ./Dockerfile
      args:
        - VERSION=${SIREN_VERSION:-latest}
    volumes:
     - ./app:/siren
    environment:
      DISCORD_TOKEN: ${DISCORD_TOKEN}
      RUST_LOG: ${RUST_LOG}
      OPENAI_API_KEY: ${OPENAI_API_KEY}
      POSTGRES_USER: ${POSTGRES_USER}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
      POSTGRES_DB: ${POSTGRES_DB}
      POSTGRES_HOST: db
    depends_on:
      - db
    restart: unless-stopped
  db:
    image: postgres:latest
    container_name: siren_db
    environment:
      POSTGRES_USER: ${POSTGRES_USER}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
      POSTGRES_DB: ${POSTGRES_DB}
    volumes:
     - ./data:/var/lib/postgresql/data
    ports:
      - "5432:5432"
    restart: unless-stopped
