:{$PORT:5000} {
    root * /usr/share/caddy

    # Proxy API calls to backend service on the internal Docker network.
    handle /api/* {
        reverse_proxy recipe-api:8080
    }

    # SPA-routing – returnera alltid index.html för okända paths
    handle {
        try_files {path} /index.html
        file_server
    }

    encode gzip
}
