admin管理员组文章数量:1399971
localhost {
root * /testDir
file_server
reverse_proxy /api/* localhost:3000
}
// And dockerfile
FROM caddy:2.7.6-alpine
EXPOSE 80
EXPOSE 443
COPY Caddyfile /etc/caddy/Caddyfile
COPY testDir /testDir
CMD ["caddy", "run"]
Checked 10 times and yes the Caddyfile is in the container in the path and yes, testDir is also there.
And of course, I build it with:
docker build -t testcaddy .
and run it with:
docker run -p 80:80 -p 443:443 -d testcaddy
And nothing happens when I type localhost in browser I get:
The site can't be reached.
localhost {
root * /testDir
file_server
reverse_proxy /api/* localhost:3000
}
// And dockerfile
FROM caddy:2.7.6-alpine
EXPOSE 80
EXPOSE 443
COPY Caddyfile /etc/caddy/Caddyfile
COPY testDir /testDir
CMD ["caddy", "run"]
Checked 10 times and yes the Caddyfile is in the container in the path and yes, testDir is also there.
And of course, I build it with:
docker build -t testcaddy .
and run it with:
docker run -p 80:80 -p 443:443 -d testcaddy
And nothing happens when I type localhost in browser I get:
The site can't be reached.
Share Improve this question edited Mar 25 at 18:24 CupOfGreenTea asked Mar 25 at 18:04 CupOfGreenTeaCupOfGreenTea 4271 gold badge5 silver badges17 bronze badges 1- What does "nothing happens" mean? Use "curl -v" and post the output. – Hamish Moffatt Commented Mar 25 at 18:45
1 Answer
Reset to default 1You have to give caddy a config file to use:
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile"]
or load it using HTTP: https://caddyserver/docs/getting-started
本文标签: dockerWhy does this simple Dockerfile fail for Caddy containerStack Overflow
版权声明:本文标题:docker - Why does this simple Dockerfile fail for Caddy container - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744177002a2594046.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论