version: '2'
 
services:
  database:
    restart: unless-stopped
    image: postgres:9.4.25
    volumes:
      - ./persist/db:/var/lib/postgresql/data
      - ./createdb.sh:/docker-entrypoint-initdb.d/init-user-db.sh
    environment:
      - DB_NAME=azurenode
      - DB_USER=idalko
      - DB_PASS=idalko
    networks:
      - database
 
  azurenode:
    restart: unless-stopped
    ports:
      - 9000:9000
    image: idalko/azurenode:5.0.9
    depends_on:
      - database #wait for postgres to be started, not for ready
    volumes:
      - volazurenode:/opt/azurenode/data
    environment:
# Add your enviroment settings here
      - AZURENODE_PG_HOST=database
      - AZURENODE_PG_DB=azurenode
      - AZURENODE_PG_USER=idalko
      - AZURENODE_PG_PWD=idalko
      - AZURENODE_PORT=9000
    networks:
      - database
      - default
volumes:
  voldatabase:
  volazurenode:

 
networks:
  database:
    driver: bridge
  default:
    driver: bridge

