version: "3.7"

services:
  r:
    image: internetofwater/r-sta-post:latest
    restart: always
    volumes:
     - type: bind
       source: ./src
       target: /src
     - type: bind
       source: ./run_use.R
       target: /src/run.R

  web:
    image: fraunhoferiosb/frost-server:latest
    restart: always
    environment:
      - serviceRootUrl=http://localhost:8080/FROST-Server
      - http_cors_enable=true
      - http_cors_allowed.origins=*
      - persistence_db_driver=org.postgresql.Driver
      - persistence_db_url=jdbc:postgresql://database:5432/sensorthings
      - persistence_db_username=sensorthings
      - persistence_db_password=ChangeMe
      - persistence_autoUpdateDatabase=true
    ports:
      - 8080:8080
      - 1883:1883
    depends_on:
      - database

  database:
    image: postgis/postgis:11-2.5-alpine
    restart: always
    environment:
      - POSTGRES_DB=sensorthings
      - POSTGRES_USER=sensorthings
      - POSTGRES_PASSWORD=ChangeMe
    volumes:
      - postgis_volume:/var/lib/postgresql/data
volumes:
    postgis_volume:
    caddy_data:
    caddy_config:

