Docker compose files for setting up automated Nginx Proxy and SSL for docker containers.
Either pull down this repository using Git:
$ git pull https://github.com/blujedis/nginx-proxy-compose.git
You can also install into your node modules using NPM if you wish. Note it is not published to NPM.
npm install blujedis/compose-nginx-proxy
Ensure you have a network available named "nginx-proxy" see below for instructions. Then run:
$ docker-compose up
OR
$ docker-compose up -d
NOTE If you've installed using NPM you'll need to cd to node_modules/compose-alpine-nginx-proxy before running docker-compose or use the -f ./node_modules/nginx-proxy-compose/docker-compose.yml
to specify the docker-compose file path.
The proxy ports default alternate ports to avoid conflicts. Use additional yaml files to override. See Compose Override below.
- 88:80
- 8443:443
You can also specify both your compose file along with production overrides depending on your environment. By specifying the compose files to run the latter file will override any keys in the main docker-compose.yml file. This is useful for dev/prod envirments.
$ docker-compose -f docker-compose.yml -f docker-compose-production.yml
The following images are included in this compose file.
- jwilder/nginx-proxy:alpine (automated Nginx proxy)
- jrcs/letsencrypt-nginx-proxy-companion (automated Letsencrypt SSL)
The following volumes are exposed for use with the proxy and letsencrypt for SSL.
Note "apps" volume would be where you store applications. In a Dockerfile you might map your container to /apps/myapp for example.
- conf:/etc/nginx/conf.d
- vhost:/etc/nginx/vhost.d
- certs:/etc/nginx/certs:ro
- html:/usr/share/nginx/html
Requires the network "nginx-proxy" to be available. You can create this network by running:
$ docker network create --opt com.docker.network.bridge.name=nginx-proxy nginx-proxy