Skip to content

Instantly share code, notes, and snippets.

@alessfg
Created September 7, 2016 11:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alessfg/f9c4f330850858b9afaea33de5595774 to your computer and use it in GitHub Desktop.
Save alessfg/f9c4f330850858b9afaea33de5595774 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment