version: '2.2'
services:

  data-dir-conf:
    image: geonode/geoserver_data:latest
    restart: on-failure
    container_name: gsconf4${COMPOSE_PROJECT_NAME}
    labels:
        org.geonode.component: conf
        org.geonode.instance.name: geonode
    command: /bin/true
    volumes:
      - geoserver-data-dir:/geoserver_data/data

  geoserver:
    image: geonode/geoserver:latest
    restart: unless-stopped
    container_name: geoserver4${COMPOSE_PROJECT_NAME}
    stdin_open: true
    # tty: true
    labels:
        org.geonode.component: geoserver
        org.geonode.instance.name: geonode
    depends_on:
      - data-dir-conf
    volumes:
      - geoserver-data-dir:/geoserver_data/data
    env_file:
      - .env
    ports:
      - "${GEOSERVER_SERVER_PORT}:8080"
    network_mode: "bridge"

volumes:
  geoserver-data-dir:
    name: ${COMPOSE_PROJECT_NAME}-gsdatadir
