-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker compose #3
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
rust-demo-app/target | ||
/.idea/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Use sozu as reverse-proxy with docker-compose (using tube-cheese) | ||
|
||
First, you have to install [docker-compose](https://docs.docker.com/compose/install/) to execute this demo | ||
|
||
We have to add the domain names to our */etc/hosts* file | ||
``` | ||
127.0.0.1 pikachu.local mewtwo.local nidoqueen.local | ||
``` | ||
|
||
If you want to use Docker Machine, you can too. Just put the right ip into /etc/hosts `docker-machine ip` | ||
|
||
First, we will start the local containers (it takes few minutes): | ||
``` | ||
docker-compose up -d | ||
``` | ||
|
||
Next, deploy the many pokemons containers | ||
``` | ||
docker-compose -f docker-compose.pokemons.yml up -d | ||
``` | ||
|
||
Open browser and try to open these urls to discover the proxying is working. | ||
* [pikachu.local](http://pikachu.local) | ||
* [mewtwo.local](http://mewtwo.local) | ||
* [nidoqueen.local](http://nidoqueen.local) | ||
|
||
Best for now is to open all files and play with it ;-) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
command_socket = "/var/run/sozu/socket" | ||
saved_state = "./state.json" | ||
log_level = "debug" | ||
log_target = "stdout" | ||
command_buffer_size = 16384 | ||
|
||
[metrics] | ||
address = "192.168.59.103" | ||
port = 8125 | ||
|
||
[proxies] | ||
|
||
[proxies.HTTP] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The configuration now use a |
||
address = "0.0.0.0" | ||
proxy_type = "HTTP" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You will add this in a protocol part. ([http] table) |
||
max_connections = 20000 | ||
port = 80 | ||
buffer_size = 16384 | ||
worker_count = 1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
defaultEntryPoints = ["http"] | ||
[web] | ||
address = ":8080" | ||
|
||
[entryPoints] | ||
[entryPoints.http] | ||
address = ":8081" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
version: "3" | ||
|
||
services: | ||
|
||
pikachu: | ||
container_name: pikachu | ||
image: "clevercloud/demo-pokemon" | ||
environment: | ||
- POKEMON_NUMBER=25 | ||
- MESSAGE="Pika Pika" | ||
labels: | ||
# comment the line if you use xip.io | ||
- "traefik.frontend.rule=Host:pikachu.local" | ||
|
||
mewtwo: | ||
container_name: mewtwo | ||
image: "clevercloud/demo-pokemon" | ||
environment: | ||
- POKEMON_NUMBER=150 | ||
- MESSAGE="Mew Mew" | ||
labels: | ||
# comment the line if you use xip.io | ||
- "traefik.frontend.rule=Host:mewtwo.local" | ||
|
||
nidoqueen: | ||
container_name: nidoqueen | ||
image: "clevercloud/demo-pokemon" | ||
environment: | ||
- POKEMON_NUMBER=31 | ||
- MESSAGE="Nido Nido" | ||
labels: | ||
# comment the line if you use xip.io | ||
- "traefik.frontend.rule=Host:nidoqueen.local" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
version: "3" | ||
|
||
services: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that can be good to add a custom |
||
|
||
sozu: | ||
image: geal/sozu | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use this image instead: clevercloud/sozu |
||
container_name: sozu | ||
command: ["start", "-c", "/etc/sozu/sozu.toml"] | ||
volumes: | ||
- sozu-socket:/var/run/sozu | ||
- ./config/sozu.toml:/etc/sozu/sozu.toml | ||
ports: | ||
- "80:80" | ||
labels: | ||
- "traefik.enable=false" | ||
|
||
sozu-manager: | ||
image: geal/manager | ||
container_name: tube-cheese | ||
command: ["--config", "/etc/sozu/sozu.toml", "--api", "http://traefik:8080/api"] | ||
volumes: | ||
- sozu-socket:/var/run/sozu | ||
- ./config/sozu.toml:/etc/sozu/sozu.toml | ||
depends_on: | ||
- sozu | ||
- traefik | ||
labels: | ||
- "traefik.enable=false" | ||
|
||
traefik: | ||
image: traefik | ||
container_name: traefik | ||
command: --web --docker --docker.domain=local --logLevel=DEBUG --docker.exposedbydefault=true --docker.watch=true | ||
# if you don't want to declare manually entries into /etc/hosts, you can use the awesome xip.io | ||
# command: --web --docker --docker.domain=127.0.0.1.xip.io --logLevel=DEBUG --docker.exposedbydefault=true --docker.watch=true | ||
ports: | ||
- "9090:8080" | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
- ./config/traefik.toml:/traefik.toml | ||
labels: | ||
- "traefik.enable=false" | ||
|
||
volumes: | ||
sozu-socket: | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The table is now call
applications