fix entrypoint.sh

This commit is contained in:
sangyun 2024-01-17 20:30:15 +09:00
parent c524e2e6b9
commit 7498cabd98
3 changed files with 19 additions and 14 deletions

View File

@ -22,6 +22,8 @@ nginx-certbot
## docker compose
```yml
version: "3.5"
services:
nginx:
build: .
@ -48,4 +50,21 @@ docker exec -it nginx bash
# reload nginx
nginx -s reload
```
## acme-challenge.conf
`acme-challenge.conf` 을 conf.d 에 포함
```
server {
listen 80;
listen [::]:80;
server_name your.domain;
location ~ /.well-known/acme-challenge {
allow all;
root /var/www/html;
}
}
```

View File

@ -1,10 +0,0 @@
server {
listen 8080;
listen [::]:8080;
server_name ydev.me;
location ~ /.well-known/acme-challenge {
allow all;
root /var/www/html;
}
}

View File

@ -1,9 +1,5 @@
#!/bin/bash
# copy acme-chanllenge
echo "copy acme-challenge"
cp /home/acme-challenge.conf /etc/nginx/conf.d/acme-challenge.conf
# add crontab entry to renew the letsencrypt certificate
echo "adding crontab"
echo "0 23 * * * certbot renew --dry-run" | crontab -