Dockerfile to setup PrivateBin and Certbot inside a Docker container.
Replace example.com
with the domain you wish to use. (Dockerfile and cert.sh
before building)
docker build PrivateBin-docker -t privatebin
sudo docker run -p 80:80 -p 443:443 -i -d -t --name PrivateBin -h example.com privatebin
docker exec -i PrivateBin bash -c "cd / && bash cert.sh"
Remember to choose a different time
22 2 * * * docker exec -i PrivateBin bash -c "certbot renew --post-hook 'service apache2 stop'"
22 1 * * * docker start PrivateBin