version: "3.2"

services:
  neo:
    image: neo4j
    ports:
      - "7474:7474"
      - "7687:7687"
    volumes:
      - ./neo4j/plugins:/plugins
    environment:
      NEO4J_AUTH: none
      NEO4J_dbms_security_procedures_unrestricted: algo.*

  api:
    build: api
    ports:
      - "5000:5000"
    volumes:
      - ./api:/code/api/
    command: bash -c "code/api/wait-for-it.sh -t 30 -h neo -p 7474 -- python code/api/server.py"
    environment:
      NEO4J_PORT: ${NEO4J_PORT}
      NEO4J_PROTOCOL: ${NEO4J_PROTOCOL}
      NEO4J_HOST: ${NEO4J_HOST}
      NEO4J_USER: ${NEO4J_USER}
      NEO4J_PW: ${NEO4J_PW}
      DB_PW: ${DB_PW}
      DB_HOST: ${DB_HOST}
      DB_NAME: ${DB_NAME}
      DB_PORT: ${DB_PORT}
      DB_USER: ${DB_USER}

networks:
  default:
    external:
      name: dbas_default