version: '2'
 
services:
  database:
    restart: unless-stopped
    image: postgres:9.4
    volumes:
      - ./persist/db:/var/lib/postgresql/data
      - ./createdb.sh:/docker-entrypoint-initdb.d/init-user-db.sh
    environment:
      - POSTGRES_PASSWORD=changeme
      - DB_NAME=snownode
      - DB_USER=idalko
      - DB_PASS=idalko
    networks:
      - dbnet
 
  snownode:
    restart: unless-stopped
    ports:
      - 9000:9000
 
    #
    # Change the image tag to the required version
    # Check Release History on docs.exalate.com for an overview
    #
    image: idalko/snownode:5.1.3
    depends_on:
      - database #wait for postgres to be started, not for ready
    volumes:
      - ./persist/home:/opt/snownode/data
    environment:
      # Add your enviroment settings here
      - SNOWNODE_PG_HOST=database
      - SNOWNODE_PG_DB=snownode
      - SNOWNODE_PG_USER=idalko
      - SNOWNODE_PG_PWD=idalko
      - SNOWNODE_PORT=9000
    networks:
      - dbnet
      - default
 
networks:
  dbnet:
    driver: bridge
  default:
    driver: bridge