Docker에서 Caddy 시도

2205 단어 DockerCaddy

입문


폭속!AWS EC2(Amazon Linux) 환경에서 HTTPS 환경(Caddy)을 만드는 방법를 보니 재미있어요.해보고 싶었지만 환경 구축이 번거로워 Docker로 가동을 해보기로 했습니다.

시운전하다

# ポートは片方だけでも動きます
$ docker run --rm -it -p 80:80 -p 443:443 caddy
접속 주소는 http://localhost 입니다.

안에 있는 거 보고 싶어요.

$ docker run --rm -it -p 80:80 -p 443:443 caddy /bin/ash

프로파일

/etc/caddy내유Caddyfile.
/etc/caddy/Caddyfile
# The Caddyfile is an easy way to configure your Caddy web server.
#
# Unless the file starts with a global options block, the first
# uncommented line is always the address of your site.
#
# To use your own domain name (with automatic HTTPS), first make
# sure your domain's A/AAAA DNS records are properly pointed to
# this machine's public IP, then replace the line below with your
# domain name.
:80

# Set this path to your site's directory.
root * /usr/share/caddy

# Enable the static file server.
file_server

# Another common task is to set up a reverse proxy:
# reverse_proxy localhost:8080

# Or serve a PHP site through php-fpm:
# php_fastcgi localhost:9000

# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile

끝내다


Dockerfile 같은 것을 시도하려면 아래를 참조하십시오.
caddy
Go 웹 서버 Caddy를 터치해 보았습니다.

좋은 웹페이지 즐겨찾기