docker-certbot-nginx/README.md

58 lines
1.5 KiB
Markdown
Raw Permalink Normal View History

2023-11-14 08:14:42 -06:00
# [docker-certbot-nginx](https://git.askiiart.net/askiiart/docker-certbot-nginx)
[![Build Status](https://drone.askiiart.net/api/badges/askiiart/docker-certbot-nginx/status.svg?ref=refs/heads/main)](https://drone.askiiart.net/askiiart/docker-certbot-nginx)
2023-11-14 08:07:46 -06:00
`certbot` with `nginx` support in a Docker container
## Running
Example `docker run`:
```bash
2023-11-14 13:25:43 -06:00
docker run -d -v ./nginx-conf:/etc/nginx docker.askiiart.net/askiiart/certbot-nginx certbot --version
```
Example `docker-compose.yml`:
```yaml
version: '3.7'
services:
hugo:
image: docker.askiiart.net/askiiart/certbot-nginx
volumes:
- ./nginx-conf:/etc/nginx
2023-11-14 08:07:46 -06:00
command: certbot --version
```
2023-11-14 08:07:46 -06:00
To add a DNS plugin, set the `CERTBOT_DNS_PLUGIN` environment variable to the name of the plugin to install. Plugins list [here](https://eff-certbot.readthedocs.io/en/latest/using.html#dns-plugins).
### Environment Variables
| Variable | Description | Default |
| ------------------ | ----------------------------- | ------- |
| CERTBOT_DNS_PLUGIN | The certbot dns plugin to use | none |
## Building
1. Run `docker build .`
2023-11-14 10:45:46 -06:00
## Some commands
Check if nginx config is valid:
```bash
docker run --rm -v ./nginx-conf:/etc/nginx docker.askiiart.net/askiiart/certbot-nginx nginx -t
```
First generate certs (from nginx configs):
```bash
docker run -it --rm -v ./nginx-conf:/etc/nginx docker.askiiart.net/askiiart/certbot-nginx certbot --nginx
```
Renew certs:
```bash
docker run -it --rm -v ./nginx-conf:/etc/nginx docker.askiiart.net/askiiart/certbot-nginx certbot renew
```