version: '3.8'

services:
  bricklog_server:
    container_name: BrickLog_Server
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "8080:8080"  # Expose the application on port 8080
    extra_hosts:
      - "host.docker.internal:host-gateway"  # Enables access to the host's MariaDB instance

    watchtower:
      image: v2tec/watchtower
      container_name: watchtower
      environment:
        - WATCHTOWER_TRACE=true  # Optional for debug output
      volumes:
        - /var/run/docker.sock:/var/run/docker.sock  # This allows Watchtower to interact with Docker
      restart: always  # Ensures Watchtower restarts if it stops