caddyserver / caddy-docker

Source for the official Caddy v2 Docker Image
https://hub.docker.com/_/caddy
Apache License 2.0
398 stars 73 forks source link

Pass arguments to Caddy without config file #329

Closed huntson closed 7 months ago

huntson commented 7 months ago

On Windows I am running Caddy without a file and just passing arguments via a .bat file. For a simple proxy setup, is there a way of passing something similar to the below without a config?

Start "" "C:\Users\Production\Desktop\caddy\caddy_windows_amd64.exe" reverse-proxy --from :2300 --to 172.29.1.0:80

francislavoie commented 7 months ago

Yes, just set the command for the container.

But still, strongly recommended that you use a Caddyfile. Much more flexible.

huntson commented 7 months ago

Being unfamiliar with how to do that, can you please help?

francislavoie commented 7 months ago

It's covered in the docs here: https://hub.docker.com/_/caddy. Look for caddy file-server --domain example.com