version: "3.8"

services:
  core:
    container_name: core-app
    image: redplanethq/core:${VERSION}
    environment:
      - NODE_ENV=${NODE_ENV}
      - DATABASE_URL=${DATABASE_URL}
      - DIRECT_URL=${DIRECT_URL}
      - SESSION_SECRET=${SESSION_SECRET}
      - ENCRYPTION_KEY=${ENCRYPTION_KEY}
      - MAGIC_LINK_SECRET=${MAGIC_LINK_SECRET}
      - LOGIN_ORIGIN=${LOGIN_ORIGIN}
      - APP_ORIGIN=${APP_ORIGIN}
      - REDIS_HOST=${REDIS_HOST}
      - REDIS_PORT=${REDIS_PORT}
      - REDIS_TLS_DISABLED=${REDIS_TLS_DISABLED}
      - NEO4J_URI=${NEO4J_URI}
      - NEO4J_USERNAME=${NEO4J_USERNAME}
      - NEO4J_PASSWORD=${NEO4J_PASSWORD}
      - OPENAI_API_KEY=${OPENAI_API_KEY}
      - AUTH_GOOGLE_CLIENT_ID=${AUTH_GOOGLE_CLIENT_ID}
      - AUTH_GOOGLE_CLIENT_SECRET=${AUTH_GOOGLE_CLIENT_SECRET}
      - ENABLE_EMAIL_LOGIN=${ENABLE_EMAIL_LOGIN}
      - OLLAMA_URL=${OLLAMA_URL}
      - EMBEDDING_MODEL=${EMBEDDING_MODEL}
      - MODEL=${MODEL}
      - TRIGGER_PROJECT_ID=${TRIGGER_PROJECT_ID}
      - TRIGGER_API_URL=${TRIGGER_API_URL}
      - TRIGGER_SECRET_KEY=${TRIGGER_SECRET_KEY}
    ports:
      - "3033:3000"
    depends_on:
      - redis
      - neo4j
    networks:
      - core

  redis:
    container_name: core-redis
    image: redis:7
    ports:
      - "6379:6379"
    networks:
      - core

  neo4j:
    container_name: core-neo4j
    image: neo4j:5.25-community
    environment:
      - NEO4J_AUTH=${NEO4J_AUTH}
      - NEO4J_dbms_security_procedures_unrestricted=gds.*,apoc.*
      - NEO4J_dbms_security_procedures_allowlist=gds.*,apoc.*
    ports:
      - "7474:7474"
      - "7687:7687"
    volumes:
      - type: bind
        source: /efs/neo4j
        target: /data
      - type: bind
        source: /efs/neo4j/plugins # version - 2.13.2
        target: /plugins
    networks:
      - core

networks:
  core:
    driver: bridge
