mirror of
https://github.com/umputun/reproxy.git
synced 2024-11-27 07:13:19 +03:00
add working docker compose example for docker provider
This commit is contained in:
parent
6bcb791bc5
commit
c970c176a9
@ -1,38 +0,0 @@
|
||||
|
||||
services:
|
||||
reproxy:
|
||||
build: .
|
||||
image: umputun/reproxy:master
|
||||
hostname: "reproxy"
|
||||
ports:
|
||||
- "80:8080"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
environment:
|
||||
- LISTEN=0.0.0.0:8080
|
||||
- DOCKER_ENABLED=true
|
||||
- DOCKER_NETWORK=reproxy_default
|
||||
- ASSETS_LOCATION=/web
|
||||
- DEBUG=true
|
||||
|
||||
svc1:
|
||||
image: python:3-alpine
|
||||
hostname: svc1
|
||||
ports:
|
||||
- "9091"
|
||||
command: python3 -m http.server 9091
|
||||
|
||||
svc2:
|
||||
image: python:3-alpine
|
||||
hostname: svc2
|
||||
ports:
|
||||
- "9092"
|
||||
command: python3 -m http.server 9092
|
||||
|
||||
whoami:
|
||||
image: 'containous/whoami'
|
||||
container_name: whoami
|
||||
labels:
|
||||
reproxy.server: '*'
|
||||
reproxy.route: '^/whoami/(.*)'
|
||||
reproxy.dest: '/$$1'
|
45
examples/docker/docker-compose.yml
Normal file
45
examples/docker/docker-compose.yml
Normal file
@ -0,0 +1,45 @@
|
||||
# run this example as docker-compose up and try to hit containers:
|
||||
# curl http://localhost/api/svc1/123
|
||||
# curl http://localhost/api/svc2/345
|
||||
# curl http://localhost/whoami/test
|
||||
# also try assets server:
|
||||
# curl http://localhost/1.html
|
||||
# curl http://localhost/
|
||||
|
||||
services:
|
||||
reproxy:
|
||||
build: .
|
||||
image: umputun/reproxy:master
|
||||
container_name: reproxy
|
||||
hostname: reproxy
|
||||
ports:
|
||||
- "80:8080"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ./web:/web
|
||||
environment:
|
||||
- LISTEN=0.0.0.0:8080
|
||||
- DOCKER_ENABLED=true
|
||||
- ASSETS_LOCATION=/web
|
||||
- DEBUG=true
|
||||
|
||||
svc1:
|
||||
image: hashicorp/http-echo
|
||||
hostname: svc1
|
||||
container_name: svc1
|
||||
command: -text="hello world from svc1"
|
||||
|
||||
svc2:
|
||||
image: hashicorp/http-echo
|
||||
hostname: svc2
|
||||
container_name: svc2
|
||||
command: -text="hello world from svc2"
|
||||
|
||||
whoami:
|
||||
image: 'containous/whoami'
|
||||
hostname: whoami
|
||||
container_name: whoami
|
||||
labels:
|
||||
reproxy.server: '*'
|
||||
reproxy.route: '^/whoami/(.*)'
|
||||
reproxy.dest: '/$$1'
|
1
examples/docker/web/1.html
Normal file
1
examples/docker/web/1.html
Normal file
@ -0,0 +1 @@
|
||||
1.html
|
1
examples/docker/web/index.html
Normal file
1
examples/docker/web/index.html
Normal file
@ -0,0 +1 @@
|
||||
index
|
Loading…
Reference in New Issue
Block a user