lucaslorentz / caddy-docker-proxy

Caddy as a reverse proxy for Docker
MIT License
2.84k stars 169 forks source link

Imports do not work #663

Open DasDunkel opened 3 days ago

DasDunkel commented 3 days ago

I've been trying to get this to work for a little while now, but it only works for me if I remove all imports (both from the source caddy file, and compose labels) All of these imports work fine using the standard method of running caddy

Error (with things omitted);

[ERROR]  Removing invalid block: Caddyfile:57: unrecognized directive: ||
example.domain {
        import ......
        reverse_proxy .....
}

This block was generated using the following compose labels

     labels:
       caddy: example.domain
       caddy.import: .......
       caddy.reverse_proxy: "{{upstreams 3000}}"

I must mention that this is using a custom build, built with the following dockerfile

FROM caddy:builder AS builder
RUN xcaddy build latest \
    --with github.com/caddyserver/transform-encoder \
    --with github.com/caddy-dns/cloudflare \
    --with github.com/lucaslorentz/caddy-docker-proxy/v2
FROM caddy:latest AS caddy
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
francislavoie commented 3 days ago

You'll need to show how you try to declare those snippets. I don't understand where || is coming from.