2018-09-28 10:50:48 +02:00
# Boilerplate for nginx with Let’ s Encrypt on docker-compose
2019-01-01 22:40:20 +01:00
> This repository is accompanied by a [step-by-step guide on how to
set up nginx and Let’ s Encrypt with Docker](https://medium.com/@pentacent/nginx -and-lets-encrypt-with-docker-in-less-than-5-minutes-b4b8a60d3a71).
2019-01-01 22:42:32 +01:00
`init-letsencrypt.sh` fetches and ensures the renewal of a Let’ s
Encrypt certificate for one or multiple domains in a docker-compose
setup with nginx.
2019-01-01 22:40:20 +01:00
This is useful when you need to set up nginx as a reverse proxy for an
application.
2018-09-28 10:50:48 +02:00
## Installation
2019-01-01 22:42:32 +01:00
1. [Install docker-compose ](https://docs.docker.com/compose/install/#install-compose ).
2018-09-28 10:50:48 +02:00
2. Clone this repository: `git clone https://github.com/wmnnd/nginx-certbot.git .`
3. Modify configuration:
- Add domains and email addresses to init-letsencrypt.sh
- Replace all occurrences of example.org with primary domain (the first one you added to init-letsencrypt.sh) in data/nginx/app.conf
2019-01-01 22:42:32 +01:00
4. Run init the script:
2018-09-28 10:50:48 +02:00
```
chmod +x ./init-letsencrypt.sh
2019-01-01 22:42:32 +01:00
./init-letsencrypt.sh
2018-09-28 10:50:48 +02:00
```
2019-01-01 22:42:32 +01:00
5. Run server:
2018-09-28 10:50:48 +02:00
`docker-compose up`
## Got questions?
Feel free to post questions in the comment section of the [accompanying guide ](https://medium.com/@pentacent/nginx-and-lets-encrypt-with-docker-in-less-than-5-minutes-b4b8a60d3a71 )
## License
All code in this repository is licensed under the terms of the `MIT License` . For further information please refer to the `LICENSE` file.