-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from LainForge/certbot
Adds SSL certificate with automatic renewal
- Loading branch information
Showing
3 changed files
with
20 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
version: '3' | ||
version: '3.7' | ||
|
||
services: | ||
lainforge: | ||
nginx: | ||
image: rohansinghagent/lainforge-home:latest | ||
container_name: lainforge-container | ||
container_name: lainforge-home | ||
volumes: | ||
- ./data/nginx:/etc/nginx/conf.d | ||
- ./data/certbot/conf:/etc/letsencrypt | ||
- ./data/certbot/www:/var/www/certbot | ||
ports: | ||
- 80:80 | ||
- 443:443 | ||
restart: unless-stopped | ||
- "80:80" | ||
- "443:443" | ||
depends_on: | ||
- certbot | ||
|
||
certbot: | ||
image: certbot/certbot | ||
container_name: certbot | ||
volumes: | ||
- ./data/certbot/conf:/etc/letsencrypt | ||
- ./data/certbot/www:/var/www/certbot | ||
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
#!/bin/sh | ||
|
||
# Check if Certbot needs to obtain or renew the certificate | ||
certbot certonly --nginx --non-interactive --agree-tos --email "[email protected]" -d lainforge.org -d www.lainforge.org | ||
|
||
# Start Nginx | ||
nginx -g "daemon off;" |