opcotech/elemo

View on GitHub
deploy/docker/docker-compose.yml

Summary

Maintainability
Test Coverage
name: elemo

volumes:
  neo4j_data: { }
  pg_data: { }

networks:
  default:
    name: elemo-network

services:
  redis:
    image: redis:7.0
    container_name: elemo-redis
    ports:
      - "6379:6379"
    healthcheck:
      test: [ "CMD", "redis-cli", "ping" ]
      interval: 5s
      timeout: 5s
      retries: 3

  neo4j:
    image: neo4j:5.6.0
    container_name: elemo-neo4j
    ports:
      - "7474:7474"
      - "7687:7687"
      - "2004:2004"
    volumes:
      - neo4j_data:/data
      - ./neo4j:/conf
    environment:
      - NEO4J_AUTH=neo4j/neo4jsecret
    healthcheck:
      test:
        [ "CMD", "cypher-shell", "-u", "neo4j", "-p", "neo4jsecret", "match (n) return count(n)" ]
      interval: 5s
      timeout: 5s
      retries: 3

  postgres:
    image: postgres:15.2
    container_name: elemo-postgres
    ports:
      - "5432:5432"
    volumes:
      - pg_data:/var/lib/postgresql/data
    environment:
      - POSTGRES_USER=elemo
      - POSTGRES_PASSWORD=pgsecret
      - POSTGRES_DB=elemo
    healthcheck:
      test: [ "CMD", "pg_isready", "-U", "elemo" ]
      interval: 5s
      timeout: 5s
      retries: 3

  smtp:
    image: richarvey/mailhog:latest
    container_name: elemo-smtp
    ports:
      - "1025:1025"
      - "8025:8025"

  elemo-server:
    image: elemo-server
    container_name: elemo-server
    build:
      context: ../../
      dockerfile: build/package/Dockerfile
    entrypoint:
      - bin/elemo
      - start
      - server
    security_opt:
      - seccomp:unconfined
    depends_on:
      redis:
        condition: service_healthy
      neo4j:
        condition: service_healthy
      postgres:
        condition: service_healthy
      smtp:
        condition: service_started
    environment:
      ELEMO_CONFIG: configs/development/config.gen.yml
    ports:
      - "35478:35478"
      - "35479:35479"

  elemo-worker:
    image: elemo-server
    container_name: elemo-worker
    build:
      context: ../../
      dockerfile: build/package/Dockerfile
    entrypoint:
      - bin/elemo
      - start
      - worker
    security_opt:
      - seccomp:unconfined
    depends_on:
      redis:
        condition: service_healthy
      neo4j:
        condition: service_healthy
      postgres:
        condition: service_healthy
      elemo-server:
        condition: service_started
      smtp:
        condition: service_started
    environment:
      ELEMO_CONFIG: configs/development/config.gen.yml
    ports:
      - "35480:35480"