version: '3.7'
services:
  sqldb:
    image: mariadb:10.4
    environment:
      MYSQL_ROOT_PASSWORD: caosdb1234
    networks:
      - caosnet
  caosdb-server:
    image: "$CI_REGISTRY/caosdb/src/caosdb-deploy:$CAOSDB_TAG"
    user: 999:999
    depends_on:
      - sqldb
    networks:
      - caosnet
    volumes:
      - type: bind
        source: ./cert
        target: /opt/caosdb/cert
      - type: volume
        source: extroot
        target: /opt/caosdb/mnt/extroot
      - type: volume
        source: scripting
        target: /opt/caosdb/git/caosdb-server/scripting
      - type: volume
        source: authtoken
        target: /opt/caosdb/git/caosdb-server/authtoken
    ports:
      # - "from_outside:from_inside"
      - "10443:10443"
      - "10080:10080"
    environment:
      DEBUG: 1
      CAOSDB_CONFIG_AUTHTOKEN_CONFIG: "conf/core/authtoken.example.yaml"
volumes:
  scripting:
  extroot:
  authtoken:
networks:
  caosnet:
    driver: bridge
