version: "3.3"
services:
  web:
    build: .
    # command: python manage.py runserver_plus --cert-file /etc/letsencrypt/live/your-domain/fullchain.pem --key-file /etc/letsencrypt/live/your-domain/privkey.pem 0.0.0.0:8000
    ports:
      - "8020:8020"
    volumes:
      - .:/app
      - ./config/certs:/app/config/certs:ro

    environment:
      - DJANGO_SETTINGS_MODULE=config.settings
      - POSTGRES_HOST=vector_db
      - POSTGRES_PORT=5432

  vector_db:
    image: pgvector/pgvector:pg16
    container_name: crm_vector_db
    environment:
      POSTGRES_USER: ${POSTGRES_USER:-postgres}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
      POSTGRES_DB: ${POSTGRES_DB:-vector_db}
    ports:
      - "5433:5432"
    volumes:
      - pg_vector_data:/var/lib/postgresql/data
    restart: unless-stopped

volumes:
  pg_vector_data:
