Is it possible to load multiple `--envfile`?

1. The problem I’m having:

I have a bunch of apps set up with compose.yaml and I’ve separated the ports and host/domain they need into their respective .env files and was hoping I’d be able to load it as variables into my Caddyfile at the root.
I’ll probably end up using systemd unit files which do let me add multiple EnvironmentFile directives, but since these values don’t change between needing to update my whole deployment, I was hoping there was a simpler option that would just get compiled in at Caddyfile-parse-time.
I probably just need to script it, but thought I’d ask.

c. Service/unit/compose file:

# Compose example setting domains and ports from env file
version: '3.6'
    image: gitlab/gitlab-ce:latest-ce.0
    hostname: '${GITLAB_DOMAIN}'
        external_url 'http://${GITLAB_DOMAIN}'
      - '${GITLAB_HTTP_PORT}:80'

d. My complete Caddy config:

	reverse_proxy localhost:{$GITLAB_HTTP_PORT}:
# OR {
	reverse_proxy localhost:8000
} {
	reverse_proxy localhost:9000

Not currently, no. But we could probably support that, I don’t see why not. PRs open if you want to take a shot at implementing it.

1 Like