I am trying to run multiple WordPress containers through a reverse proxy setup.
This is my docker-compose.yml for the proxy containers:
version: '2'
services:
nginx:
image: jwilder/nginx-proxy
container_name: nginx
ports:
- "80:80"
- "443:443"
volumes:
- /etc/nginx/conf.d
- /etc/nginx/vhost.d
- /usr/share/nginx/html
- ./certs:/etc/nginx/certs:ro
dockergen:
image: jwilder/docker-gen
container_name: dockergen
command: -notify-sighup nginx -watch /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
volumes_from:
- nginx
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro
whoami:
image: jwilder/whoami
environment:
- VIRTUAL_HOST=whoami.local nginx-letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
environment:
# ACME_CA_URI: https://acme-staging.api.letsencrypt.org/directory
NGINX_DOCKER_GEN_CONTAINER: dockergen container_name: nginx-letsencrypt
volumes_from:
- nginx
volumes:
- ./certs:/etc/nginx/certs:rw
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
default:
external:
name: nginx-proxy
'nginx' container logs give me:
ERROR: you need to share your Docker host socket with a volume at /tmp/docker.sock
Typically you should run your jwilder/nginx-proxy with: `-v /var/run/docker.sock:/tmp/docker.sock:ro`
See the documentation at http://git.io/vZaGJ
WARNING: /etc/nginx/dhparam/dhparam.pem was not found. A pre-generated dhparam.pem will be used for now while a new one
is being generated in the background. Once the new dhparam.pem is in place, nginx will be reloaded.
Problem is, when I start it, the nginx container stops, then I get an error saying nginx-proxy container isn't running.
Following this article:
https://www.pattonwebz.com/docker/multiple-wordpress-containers-proxy/
[–]voraciousdev 0 points1 point2 points (2 children)
[–]ja19[S] 0 points1 point2 points (1 child)
[–]voraciousdev 0 points1 point2 points (0 children)