Added example nginx proxy working
This commit is contained in:
@@ -1,20 +1,3 @@
|
|||||||
|
services:
|
||||||
web:
|
web:
|
||||||
build: .
|
image: nginx:latest
|
||||||
command: node index-db.js
|
|
||||||
ports:
|
|
||||||
- "3000:3000"
|
|
||||||
links:
|
|
||||||
- db
|
|
||||||
environment:
|
|
||||||
MYSQL_DATABASE: myapp
|
|
||||||
MYSQL_USER: myapp
|
|
||||||
MYSQL_PASSWORD: mysecurepass
|
|
||||||
MYSQL_HOST: db
|
|
||||||
db:
|
|
||||||
image: orchardup/mysql
|
|
||||||
ports:
|
|
||||||
- "3306:3306"
|
|
||||||
environment:
|
|
||||||
MYSQL_DATABASE: myapp
|
|
||||||
MYSQL_USER: myapp
|
|
||||||
MYSQL_PASSWORD: mysecurepass
|
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ events {}
|
|||||||
http{
|
http{
|
||||||
|
|
||||||
upstream backend{
|
upstream backend{
|
||||||
server web:80;
|
server proxy-web-1:80;
|
||||||
server web_2:80;
|
server proxy-web-2:80;
|
||||||
server web_3:80;
|
server proxy-web-3:80;
|
||||||
}
|
}
|
||||||
|
|
||||||
server{
|
server{
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
web:
|
web:
|
||||||
image: nginx:alpine
|
image: nginx:alpine
|
||||||
volumes:
|
|
||||||
- ./web:/usr/share/nginx/html:ro
|
|
||||||
|
|
||||||
proxy:
|
proxy:
|
||||||
image: nginx:alpine
|
image: nginx:alpine
|
||||||
|
|||||||
Reference in New Issue
Block a user