Sign inSign up

keinos/webapi-proxy

By keinos

Updated over 5 years ago

Custom nginx-proxy for WebAPI. Usage: See repo.

Image
0

743

keinos/webapi-proxy repository overview

Dockerfile of WebAPI-Proxy

Simple usage and lightweight Web API server. Especially to provide docker containers as API endpoint.

http://your.sample.com/[container_name]/

Usage with Docker Compose

version: '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;

Tag summary

Content type

Image

Digest

Size

21.6 MB

Last updated

over 5 years ago

docker pull keinos/webapi-proxy