Skip to content

Commit 85cf7aa

Browse files
committed
Merge branch 'master' of github.com:evertramos/docker-compose-letsencrypt-nginx-proxy-companion
2 parents be71afa + 52ce61a commit 85cf7aa

File tree

1 file changed

+29
-61
lines changed

1 file changed

+29
-61
lines changed

README.md

Lines changed: 29 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,38 @@
1-
# Usage of Docker Compose (docker-compose) with NGINX Proxy and Letsencrypt
1+
# A Web Proxy using Docker, NGINX and Let's Encrypt
22

3-
Docker Compose (docker-compose) for [docker-letsencrypt-nginx-proxy-companion](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion)
3+
With this repo you will be able to set up your server with multiple sites using a single NGINX proxy to manage your connections.
44

5+
Something like:
56

6-
## Purpose
7+
![Proxy Enviornment](https://cdn-images-1.medium.com/max/873/1*rnzxfcy2N_ffJPnBundJQw.jpeg)
78

8-
This docker-compose file, version '3', was built to help using NGINX as web proxy to your containers, integrated with LetsEncrypt certification, using the great work of [@jwilder](https://github.com/jwilder) with [docker-gen](https://github.com/jwilder/docker-gen) and [nginx-proxy](https://github.com/jwilder/nginx-proxy) along with the ultimate tool [docker-letsencrypt-nginx-proxy-companion](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion) designed by [JrCs](https://github.com/JrCs) to integrate the great SSL Certificates from the best [LetsEncrypt](https://letsencrypt.org/).
99

10+
## Why use it?
1011

11-
## Usage
12+
Using this set up you will be able start a productyion enviornment in a few seconds. And to start new web project simply start new containers the option `-e VIRTUAL_HOST=your.domain.com` and will be ready to go, if you want to use SSL (Let's Encrypt) just add the tag `-e LETSENCRYPT_HOST=your.domain.com`. Done!
1213

13-
In order to use, you must follow these steps:
14+
Easy and trustworthy!
1415

15-
1. Clone this repository:
1616

17-
```bash
18-
git clone https://github.com/evertramos/webproxy.git
19-
```
17+
## Prerequisites
18+
19+
In order to use this compose file (docker-compose.yml) you must have:
2020

21-
Or just copy the content of `docker-compose.yml`, as of below and substitute with your own configuration settings:
21+
1. docker (https://docs.docker.com/engine/installation/)
22+
2. docker-compose (https://docs.docker.com/compose/install/)
23+
24+
25+
## How to use it
26+
27+
1. Clone this repository:
2228

2329
```bash
24-
version: '3'
25-
services:
26-
nginx:
27-
image: nginx
28-
labels:
29-
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
30-
container_name: ${NGINX_WEB}
31-
restart: unless-stopped
32-
ports:
33-
- "${IP}:80:80"
34-
- "${IP}:443:443"
35-
volumes:
36-
- ${NGINX_FILES_PATH}/conf.d:/etc/nginx/conf.d
37-
- ${NGINX_FILES_PATH}/vhost.d:/etc/nginx/vhost.d
38-
- ${NGINX_FILES_PATH}/html:/usr/share/nginx/html
39-
- ${NGINX_FILES_PATH}/certs:/etc/nginx/certs:ro
40-
41-
nginx-gen:
42-
image: jwilder/docker-gen
43-
command: -notify-sighup nginx -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
44-
container_name: ${DOCKER_GEN}
45-
restart: unless-stopped
46-
volumes:
47-
- ${NGINX_FILES_PATH}/conf.d:/etc/nginx/conf.d
48-
- ${NGINX_FILES_PATH}/vhost.d:/etc/nginx/vhost.d
49-
- ${NGINX_FILES_PATH}/html:/usr/share/nginx/html
50-
- ${NGINX_FILES_PATH}/certs:/etc/nginx/certs:ro
51-
- /var/run/docker.sock:/tmp/docker.sock:ro
52-
- ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro
53-
54-
nginx-letsencrypt:
55-
image: jrcs/letsencrypt-nginx-proxy-companion
56-
container_name: ${LETS_ENCRYPT}
57-
restart: unless-stopped
58-
volumes:
59-
- ${NGINX_FILES_PATH}/conf.d:/etc/nginx/conf.d
60-
- ${NGINX_FILES_PATH}/vhost.d:/etc/nginx/vhost.d
61-
- ${NGINX_FILES_PATH}/html:/usr/share/nginx/html
62-
- ${NGINX_FILES_PATH}/certs:/etc/nginx/certs:rw
63-
- /var/run/docker.sock:/var/run/docker.sock:ro
64-
environment:
65-
NGINX_DOCKER_GEN_CONTAINER: ${DOCKER_GEN}
66-
NGINX_PROXY_CONTAINER: ${NGINX_WEB}
67-
68-
networks:
69-
default:
70-
external:
71-
name: ${NETWORK}
30+
git clone https://github.com/evertramos/docker-compose-letsencrypt-nginx-proxy-companion.git
7231
```
7332

74-
2. Create an `.env` file as of our `.env.sample`, save it in the same folder as your compose file:
33+
2. Make a copy of our `.env.sample` and rename it to `.env`:
34+
35+
Update this file with your preferences.
7536

7637
```
7738
#
@@ -105,9 +66,16 @@ NGINX_FILES_PATH=/path/to/your/nginx/data
10566

10667
Your proxy is ready to go!
10768

69+
5. Test your proxy
70+
71+
```bash
72+
docker run -dit -e VIRTUAL_HOST=your.domain.com --network=webproxy --name test-web httpd:alpine
73+
```
74+
75+
And access your browser with your domain already configured in your dns.
10876

109-
> Please note that when running a new container to generate certificates with LetsEncrypt it may take a few minutes, depending on multiples circunstances.
11077

78+
> Please note that when running a new container to generate certificates with LetsEncrypt (`-e LETSENCRYPT_HOST=your.domain.com`), it may take a few minutes, depending on multiples circunstances.
11179
11280

11381
## Next Step

0 commit comments

Comments
 (0)