alessfg
9/7/2016 - 11:01 AM

Docker compose file to start EtherCIS and OpenEMPI simultaneously

Docker compose file to start EtherCIS and OpenEMPI simultaneously

version: "2"

services:

  ethercis_app:
    # Build EtherCIS application using Dockerfile contained in EtherCIS
    # application subfolder
    build: ./etherCIS/application
    # Name image
    image: ethercis-app
    # Map EtherCIS application container port 8080 to Docker port 8888
    ports:
      - "8888:8080"
    # Do not start EtherCIS application container until EtherCIS postgres
    # container is started
    depends_on:
      - ethercis_postgres
    # Link EtherCIS application container to EtherCIS network
    networks:
      - etherCIS

  ethercis_postgres:
    # Build EtherCIS database using Dockerfile contained in EetherCIS
    # postgres subfolder
    build: ./etherCIS/postgres
    # Name image
    image: ethercis-db
    # Link EtherCIS database container to EtherCIS network and assign it the
    # alias of postgres within the network
    networks:
      etherCIS:
        aliases:
          - postgres

  openempi_app:
    # Build OpenEMPI application using Dockerfile contained in openEMPI
    # application subfolder
    build: ./openEMPI/application
    # Name image
    image: openempi-app
    # Map OpenEMPI application container port 8080 to Docker port 8080
    ports:
      - "8080:8080"
    # Do not start OpenEMPI application container until OpenEMPI postgres
    # container is started
    depends_on:
      - openempi_postgres
    # Link OpenEMPI application container to OpenEMPI network
    networks:
      - openEMPI

  openempi_postgres:
    # Build OpenEMPI database using Dockerfile contained in openEMPI
    # postgres subfolder
    build: ./openEMPI/postgres
    # Name image
    image: openempi-db
    # Link OpenEMPI database container to OpenEMPI network and assign it the
    # alias of postgres within the network
    networks:
      openEMPI:
        aliases:
          - postgres

# Create EtherCIS and OpenEMPI networks using bridge driver
networks:

  etherCIS:
    driver: bridge

  openEMPI:
    driver: bridge