2 Star 9 Fork 4

刘悦的技术博客 / nginx_keepalive

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
docker-compose.yml 1.00 KB
Copy Edit Web IDE Raw Blame History
liuyue authored 2019-10-18 06:41 . first commit
version: "3"
services:
nginx_master:
build:
context: ./
dockerfile: ./Dockerfile
volumes:
- ./index-master.html:/usr/share/nginx/html/index.html
- ./favicon.ico:/usr/share/nginx/html/favicon.ico
- ./keepalived-master.conf:/etc/keepalived/keepalived.conf
networks:
static-network:
ipv4_address: 172.20.128.2
cap_add:
- NET_ADMIN
nginx_slave:
build:
context: ./
dockerfile: ./Dockerfile
volumes:
- ./index-slave.html:/usr/share/nginx/html/index.html
- ./favicon.ico:/usr/share/nginx/html/favicon.ico
- ./keepalived-slave.conf:/etc/keepalived/keepalived.conf
networks:
static-network:
ipv4_address: 172.20.128.3
cap_add:
- NET_ADMIN
proxy:
image: haproxy:1.7-alpine
ports:
- 8000:6301
volumes:
- ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
networks:
- static-network
networks:
static-network:
ipam:
config:
- subnet: 172.20.0.0/16

Comment ( 0 )

Sign in for post a comment

1
https://gitee.com/QiHanXiBei/nginx_keepalive.git
git@gitee.com:QiHanXiBei/nginx_keepalive.git
QiHanXiBei
nginx_keepalive
nginx_keepalive
master

Search