Custom nginx-proxy for WebAPI. Usage: See repo.
743
Simple usage and lightweight Web API server. Especially to provide docker containers as API endpoint.
http://your.sample.com/[container_name]/
keinos/webapi-proxyversion: '3'
services:
nginx-proxy:
image: keinos/webapi-proxy
ports:
- "8000:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
app1:
container_name: app1
image: keinos/mini-php7
volumes:
- ./App-1/index.php:/app/htdocs/index.php
With the docker-compose.yml above, you will be able to access containers like below.
$ docker-compose up -d
...
$ curl http://localhost:8000/app1/
Hello World! I'm App-1!
The index.php of the "App-1":
<?php
header("Content-Type: text/plain");
echo 'Hello World! I\'m App-1!' . PHP_EOL;
Content type
Image
Digest
Size
21.6 MB
Last updated
over 5 years ago
docker pull keinos/webapi-proxy