version: "3.7"
services:
  parse-server:
    image: parseplatform/parse-server
    environment:
      - PARSE_SERVER_APPLICATION_ID=myAPP
      - PARSE_SERVER_MASTER_KEY=myKEY
      - PARSE_SERVER_DATABASE_URI=postgres://${DB_USER}:${DB_PASS}@db:5432/${DB_NAME}
    ports:
      - "1337:1337"
    volumes:
      - ./cloud:/parse-server/cloud
    links:
      - db:db
    depends_on:
     - db
  
  db:
    image: kartoza/postgis:13.0
    restart: always
    environment:
      # If you need to create multiple database you can add coma separated databases eg gis,data
      - POSTGRES_DB=${DB_NAME}
      - POSTGRES_USER=${DB_USER}
      - POSTGRES_PASS=${DB_PASS}
      # - ALLOW_IP_RANGE=0.0.0.0/0
      # Add extensions you need to be enabled by default in the DB. Default are the five specified below
      - POSTGRES_MULTIPLE_EXTENSIONS=postgis,hstore,postgis_topology,postgis_raster,pgrouting
    volumes:
      - ./appdata/postgis:/var/lib/postgresql
  
  parse-dashboard:
    image: parseplatform/parse-dashboard
    ports:
      - "4040:4040"
    volumes:
      - ./config.json:/src/Parse-Dashboard/parse-dashboard-config.json
    links:
      - parse-server:parse-server
    depends_on:
      - parse-server
    command : parse-dashboard --config /src/Parse-Dashboard/parse-dashboard-config.json --allowInsecureHTTP true
