|
1 |
| -# docker-proxy |
| 1 | +# Docker-proxy |
| 2 | + |
| 3 | +A HTTP reverse proxy for docker. |
| 4 | + |
| 5 | +## Requirements |
| 6 | + |
| 7 | +- [Docker](https://docs.docker.com/install/#supported-platforms) >= 18.09.6 |
| 8 | +- [Docker compose](https://docs.docker.com/compose/install) >= 1.24.0 |
| 9 | + |
| 10 | +## External dependency |
| 11 | + |
| 12 | +Web server: |
| 13 | +- [Nginx](https://github.com/philippe-vandermoere/docker-proxy-nginx) |
| 14 | + |
| 15 | +The web server is automatically configure when you add/remove a container by one of this provider |
| 16 | +- [PHP](https://github.com/philippe-vandermoere/docker-proxy-php) |
| 17 | +- [GO](https://github.com/philippe-vandermoere/docker-proxy-go) (experimental) |
| 18 | + |
| 19 | +## Installation |
| 20 | + |
| 21 | +```bash |
| 22 | +git clone https://github.com/philippe-vandermoere/docker-proxy |
| 23 | +docker-proxy/start.sh |
| 24 | +``` |
| 25 | + |
| 26 | +The script: |
| 27 | +- Ask you to configure docker-proxy: |
| 28 | + - `HTTP_PORT`: Define the listen http port of proxy (default 80). |
| 29 | + - `HTTPS_PORT`: Define the listen https port of proxy (default 443). |
| 30 | + - `NGINX_VERSION`: Define the version of nginx service (default latest). |
| 31 | + - `PROXY_PROVIDER`: Define the provider of proxy (default php). |
| 32 | + - `PROXY_PROVIDER_VERSION`: Define The version of provider of proxy (default latest). |
| 33 | + |
| 34 | +- Start the stack |
| 35 | + |
| 36 | +You can see the list of containers managed by proxy on http://127.0.0.1:${HTTP_PORT} |
| 37 | + |
| 38 | +## Container configuration |
| 39 | + |
| 40 | +### General configuration |
| 41 | + |
| 42 | +- `com.docker-proxy.domain`: Define the domain of your service (require). |
| 43 | +- `com.docker-proxy.port`: Define the http port of your service (default 80). |
| 44 | +- `com.docker-proxy.path`: Define the domain path of your service (default /). |
| 45 | +- `com.docker-proxy.sslcom.docker-proxy.ssl`: Define if you need https (default: false). |
| 46 | + |
| 47 | +### Certificate provider Configuration |
| 48 | + |
| 49 | +#### Github |
| 50 | + |
| 51 | +- `com.docker-proxy.certificate-provider.name`: Define the provider name (require github). |
| 52 | +- `com.docker-proxy.certificate-provider.token`: Define the github token (require). |
| 53 | +- `com.docker-proxy.certificate-provider.repository`: Define the github repository (require). |
| 54 | +- `com.docker-proxy.certificate-provider.reference`: Define the git reference (default: master). |
| 55 | +- `com.docker-proxy.certificate-provider.certificate_path`: Define the path of certificate (require). |
| 56 | +- `com.docker-proxy.certificate-provider.private_key_path`: Define the path of private key (require). |
| 57 | + |
| 58 | +### Examples |
| 59 | + |
| 60 | +#### HTTP |
| 61 | + |
| 62 | +```docker |
| 63 | +version: '3.5' |
| 64 | +services: |
| 65 | + nginx: |
| 66 | + image: nginx:1.16.0-alpine |
| 67 | + labels: |
| 68 | + com.docker-proxy.domain: test.loc |
| 69 | +``` |
| 70 | + |
| 71 | +#### HTTPS generate self-signed certificate |
| 72 | + |
| 73 | +```docker |
| 74 | +version: '3.5' |
| 75 | +services: |
| 76 | + nginx: |
| 77 | + image: nginx:1.16.0-alpine |
| 78 | + labels: |
| 79 | + com.docker-proxy.domain: test.loc |
| 80 | + com.docker-proxy.ssl: true |
| 81 | +``` |
| 82 | + |
| 83 | +#### HTTPS download certificate from github |
| 84 | + |
| 85 | +```docker |
| 86 | +version: '3.5' |
| 87 | +services: |
| 88 | + nginx: |
| 89 | + image: nginx:1.16.0-alpine |
| 90 | + labels: |
| 91 | + com.docker-proxy.domain: test.loc |
| 92 | + com.docker-proxy.ssl: true |
| 93 | + com.docker-proxy.certificate-provider.name: github |
| 94 | + com.docker-proxy.certificate-provider.token: {github_token} |
| 95 | + com.docker-proxy.certificate-provider.repository: {github_orga}/{github_repository} |
| 96 | + com.docker-proxy.certificate-provider.certificate_path: {github_certificate_path} |
| 97 | + com.docker-proxy.certificate-provider.private_key_path: {github_private_key_path} |
| 98 | +``` |
0 commit comments