laudis-technologies/neo4j-php-client

View on GitHub
docker-compose.yml

Summary

Maintainability
Test Coverage
version: '3.8'

x-definitions:
  x-shared-env:
    &common-env
    NEO4J_AUTH: neo4j/testtest
    NEO4J_PLUGINS: '["apoc"]'
  x-shared-cluster-env:
    &common-cluster-env
    <<: *common-env
    NEO4J_ACCEPT_LICENSE_AGREEMENT: 'yes'
    NEO4J_dbms_cluster_discovery_endpoints: server1:5000,server2:5000,server3:5000
  x-shared-core-env:
    &common-core-env
    <<: *common-cluster-env
    NEO4J_initial_server_mode__constraint: 'PRIMARY'
  x-common:
    &common
    image: neo4j:5-enterprise
    healthcheck:
      test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider localhost:7474 || exit 1" ]
    env_file:
      - .env
  x-common-php:
    &common-php
    build:
      context: .
      dockerfile: Dockerfile
#    image: neo4j-php-client:latest
    volumes:
      - .:/opt/project
  x-common-cluster:
    &common-cluster
    <<: *common
    image: neo4j:5-enterprise
    networks:
      neo4j-cluster:

networks:
  neo4j:
  neo4j-cluster:

services:
  client:
    <<: *common-php
    networks:
      - neo4j
      - neo4j-cluster
    volumes:
      - .:/opt/project
    env_file:
      - .env
  neo4j:
    <<: *common
    image: neo4j:5.10-community
    hostname: neo4j
    networks:
      - neo4j
    ports:
      - "11687:7687"
      - "11474:7474"
    environment:
      <<: *common-env
      NEO4j_server_bolt_advertised_address: localhost:11687
      NEO4j_server_http_advertised_address: localhost:11474

  server1:
    <<: *common-cluster
    hostname: server1
    ports:
      - "7687:7687"
      - "7473:7473"
      - "7474:7474"
    environment:
      <<: *common-core-env
      NEO4j_server_bolt_advertised_address: localhost:7687
      NEO4j_server_http_advertised_address: localhost:7474

  server2:
    <<: *common-cluster
    hostname: server2
    ports:
      - "8687:7687"
      - "8473:7473"
      - "8474:7474"
    environment:
      <<: *common-core-env
      NEO4j_server_bolt_advertised_address: localhost:8687
      NEO4j_server_http_advertised_address: localhost:8474

  server3:
    <<: *common-cluster
    hostname: server3
    ports:
      - "9474:7474"
      - "9473:7473"
      - "9687:7687"
    environment:
      <<: *common-core-env
      NEO4j_server_bolt_advertised_address: localhost:9687
      NEO4j_server_http_advertised_address: localhost:9474

  server4:
    <<: *common-cluster
    hostname: server4
    ports:
      - "10474:7474"
      - "10473:7473"
      - "10687:7687"
    environment:
      <<: *common-cluster-env
      NEO4J_initial_server_mode__constraint: 'SECONDARY'
      NEO4j_server_bolt_advertised_address: localhost:10687
      NEO4j_server_http_advertised_address: localhost:10474