Skip to content

Commit

Permalink
add load balancing to the broker for multiples instance deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe Stemberger committed Sep 2, 2019
1 parent 6aa0e78 commit 6922c00
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
2 changes: 1 addition & 1 deletion broker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Run the following command
## Usage

```python
docker-compose up
docker-compose up --scale broker-gitlab=2
```

## Contributing
Expand Down
20 changes: 16 additions & 4 deletions broker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,25 @@ version: '3'
services:
broker-gitlab:
image: snyk/broker:gitlab
ports:
- "7000:7000"
expose:
- "7000"
env_file:
-./gitlab.env
- ./gitlab.env
# broker-github:
# image: snyk/broker:github
# ports:
# - "7001:7001"
# env_file:
# -./github.env
# -./github.env



nginx:
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- broker-gitlab
# - broker-github
ports:
- "4000:4000"
13 changes: 13 additions & 0 deletions broker/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
user nginx;

events {
worker_connections 1000;
}
http {
server {
listen 4000;
location / {
proxy_pass http://broker-gitlab:7000;
}
}
}

0 comments on commit 6922c00

Please sign in to comment.