ユーザ用ツール

サイト用ツール


サイドバー

このページの翻訳:



最近の更新



Tag Cloud

06_virtualization:05_container:10_docker_let_s_encrypt

文書の過去の版を表示しています。


10 Docker Let's Encrypt

certbot のdockerイメージ利用

Let's Encryptの証明書だけサッと利用したい場合にとても便利

※network_mode: hostで利用したい場合は、firewallも開ける

docker-compose.yml

---
version: "3"
services:
  nginx:
    image: nginx
    restart: always
    volumes:
      - /etc/nginx/conf.d:/etc/nginx/conf.d
      - /etc/letsencrypt:/etc/letsencrypt
      - /var/www/html:/var/www/html
    ports:
      - 80:80
    #network_mode: host

  certbot:
    image: certbot/certbot
    volumes:
      - /etc/letsencrypt:/etc/letsencrypt
      - /var/www/html:/var/www/html
    command: ["--version"]

証明書作成

docker-compose run --rm certbot certonly --webroot -w /var/www/html -d hogehoge.com

証明書更新

docker-compose run --rm certbot renew
06_virtualization/05_container/10_docker_let_s_encrypt.1647816173.txt.gz · 最終更新: 2022/03/21 07:42 by matsui