wemake-services / caddy-gen

Automated Caddy reverse proxy for docker containers
https://hub.docker.com/r/wemakeservices/caddy-gen
MIT License
250 stars 24 forks source link

feat: add an additional Caddyfile config template to the existing template #50

Closed couetilc closed 3 years ago

couetilc commented 3 years ago

This could be a potential fix for #2 , not sure if you all would prefer to add to the existing template, or replace it altogether. There could be separate env var for each option. What do you think of these changes? (explanation in README changes)

couetilc commented 3 years ago

I could also add a CADDY_FILE envvar that will replace the default Caddyfile.tmpl in a similar manner to how CADDY_SNIPPET is appended to the default Caddyfile. So there would be two options for custom templates: CADDY_FILE which will replace the default template, and CADDY_SNIPPET which will append to the existing template. Unfortunately, I do not think it's easy to support adding multiple snippets.

couetilc commented 3 years ago

I'll think of a way to test, I'll update the .travis.yml file

couetilc commented 3 years ago

@sobolevn I rebased with master and added tests to the CI, any feedback is welcome.

sobolevn commented 3 years ago

Looks like I broke something 😢

couetilc commented 3 years ago

Looks good I think we can merge, thank you for the feedback @sobolevn . I will update docs today for #52 demonstrating how to set up a file_server with the new options, then rebase, and add a feature to include snippets using container labels. We should be good to release after that.