1
-
2
- # THIS REPO WAS CONVERTED TO WEBPROXY
3
- ## https://github.com/evertramos/webproxy/
4
- (to simplify naming convetion)
5
-
6
- It will be synced until Jun of 2018.
7
-
8
- ---
9
-
10
- # Usage of Docker Compose (docker-compose) with NGINX proxy and Letsencrypt
1
+ # Usage of Docker Compose (docker-compose) with NGINX Proxy and Letsencrypt
11
2
12
3
Docker Compose (docker-compose) for [ docker-letsencrypt-nginx-proxy-companion] ( https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion )
13
4
@@ -24,10 +15,10 @@ In order to use, you must follow these steps:
24
15
1 . Clone this repository:
25
16
26
17
``` bash
27
- git clone https://github.com/evertramos/docker-compose-letsencrypt-nginx-proxy-companion .git
18
+ git clone https://github.com/evertramos/webproxy .git
28
19
```
29
20
30
- Or just copy the content of ` docker-compose.yml ` , as of below:
21
+ Or just copy the content of ` docker-compose.yml ` , as of below and substitute with your own configuration settings :
31
22
32
23
``` bash
33
24
version: ' 3'
@@ -36,11 +27,11 @@ services:
36
27
image: nginx
37
28
labels:
38
29
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: " true"
39
- container_name: nginx
30
+ container_name: ${NGINX_WEB}
40
31
restart: unless-stopped
41
32
ports:
42
- - " 80:80"
43
- - " 443:443"
33
+ - " ${IP} : 80:80"
34
+ - " ${IP} : 443:443"
44
35
volumes:
45
36
- ${NGINX_FILES_PATH} /conf.d:/etc/nginx/conf.d
46
37
- ${NGINX_FILES_PATH} /vhost.d:/etc/nginx/vhost.d
@@ -50,7 +41,7 @@ services:
50
41
nginx-gen:
51
42
image: jwilder/docker-gen
52
43
command: -notify-sighup nginx -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
53
- container_name: nginx-gen
44
+ container_name: ${DOCKER_GEN}
54
45
restart: unless-stopped
55
46
volumes:
56
47
- ${NGINX_FILES_PATH} /conf.d:/etc/nginx/conf.d
@@ -62,7 +53,7 @@ services:
62
53
63
54
nginx-letsencrypt:
64
55
image: jrcs/letsencrypt-nginx-proxy-companion
65
- container_name: nginx-letsencrypt
56
+ container_name: ${LETS_ENCRYPT}
66
57
restart: unless-stopped
67
58
volumes:
68
59
- ${NGINX_FILES_PATH} /conf.d:/etc/nginx/conf.d
@@ -71,54 +62,52 @@ services:
71
62
- ${NGINX_FILES_PATH} /certs:/etc/nginx/certs:rw
72
63
- /var/run/docker.sock:/var/run/docker.sock:ro
73
64
environment:
74
- NGINX_DOCKER_GEN_CONTAINER: " nginx-gen"
75
- NGINX_PROXY_CONTAINER: " nginx"
76
- ```
77
-
78
- 2 . Create an ` .env ` file and say where you will locate the nginx files:
79
-
80
- ```
81
- NGINX_FILES_PATH=/path/to/your/nginx/data
82
- ```
83
-
84
- 3 . Change the file ` docker-compose.yml ` with you own settings:
85
-
86
- 3.1. Set your PROXY Network
65
+ NGINX_DOCKER_GEN_CONTAINER: ${DOCKER_GEN}
66
+ NGINX_PROXY_CONTAINER: ${NGINX_WEB}
87
67
88
- Your wordpress container must be in the same network of your nginx proxy.
89
- ``` bash
90
68
networks:
91
69
default:
92
70
external:
93
- name: your-network-name
71
+ name: ${NETWORK}
94
72
```
95
73
96
- 3.2. Set your IP address (optional)
97
-
98
- On the line ` ports ` add as follow:
99
- ``` bash
100
- ports:
101
- - " YOUR_PUBLIC_IP:80:80"
102
- - " YOUR_PUBLIC_IP:443:443"
74
+ 2 . Create an ` .env ` file as of our ` .env.sample ` , save it in the same folder as your compose file:
103
75
76
+ ```
77
+ #
78
+ # WEBPROXY
79
+ #
80
+ # A Web Proxy using docker with NGINX with Let's Encrypt
81
+ # And our great community docker-gen, nginx-proxy and docker-letsencrypt-nginx-proxy-companion
82
+ #
83
+ # This is the .env file to set up your webproxy enviornment
84
+
85
+ # Define the names for your local containers
86
+ NGINX_WEB=nginx-web
87
+ DOCKER_GEN=nginx-gen
88
+ LETS_ENCRYPT=nginx-letsencrypt
89
+
90
+ # Your external IP address
91
+ IP=0.0.0.0
92
+
93
+ # Network name
94
+ NETWORK=webproxy
95
+
96
+ # NGINX file path
97
+ NGINX_FILES_PATH=/path/to/your/nginx/data
104
98
```
105
99
106
- 4 . Get the latest version of ** nginx.tmpl ** file (only if you have not cloned this repostiry)
100
+ 4 . Run our start script
107
101
108
102
``` bash
109
- curl https://raw.githubusercontent.com/jwilder/nginx-proxy/master/nginx.tmpl > nginx.tmpl
103
+ # ./run.sh
110
104
```
111
- Make sure you are in the same folder of docker-compose file, if not, you must update the the settings ` - ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro ` .
112
105
113
- 5 . Start your project
114
- ``` bash
115
- docker-compose up -d
116
- ```
106
+ Your proxy is ready to go!
117
107
118
- > Please note that when running a new container to generate certificates with LetsEncrypt it may take a few minutes, depending on multiples circunstances.
119
108
109
+ > Please note that when running a new container to generate certificates with LetsEncrypt it may take a few minutes, depending on multiples circunstances.
120
110
121
- Your proxy is ready to go!
122
111
123
112
124
113
## Next Step
@@ -134,8 +123,9 @@ Or you can run your own containers with the option `-e VIRTUAL_HOST=foo.bar.com`
134
123
## Credits
135
124
136
125
All credits goes to:
137
- - [ @jwilder ] ( https://github.com/jwilder/nginx-proxy )
138
- - [ @JrCs ] ( https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion )
126
+ - nginx-proxy [ @jwilder ] ( https://github.com/jwilder/nginx-proxy )
127
+ - docker-gen [ @jwilder ] ( https://github.com/jwilder/docker-gen )
128
+ - dockher-letsencrypt-nginx-proxy-companion [ @JrCs ] ( https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion )
139
129
140
130
141
131
### Special thanks to:
0 commit comments