Files
common-server-public/certbot/docker-compose.yml
张威33321 fb87be680d 0908
2026-09-08 20:36:17 +08:00

33 lines
981 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
services:
certbot:
build: .
image: common-server-certbot:latest
# 一次性任务容器,不常驻:
# docker compose run --rm certbot certonly ... # 申请
# docker compose run --rm certbot renew # 续签
# 注意:官方镜像 ENTRYPOINT 已经是 certbot命令里不要再写一遍 certbot。
volumes:
- certbot-webroot:/var/www/certbot
- certbot-certs:/etc/letsencrypt
- certbot-logs:/var/log/letsencrypt
networks:
- trim-default
volumes:
# 固定物理卷名,供 nginx/docker-compose.yml 以 external 方式引用。
# compose 默认会给卷名加项目名前缀,两个 compose 项目目录不同,
# 不显式指定 name 会导致两侧指向不同的卷。
certbot-webroot:
name: certbot-webroot
driver: local
certbot-certs:
name: certbot-certs
driver: local
certbot-logs:
name: certbot-logs
driver: local
networks:
trim-default:
external: true