dns-proxy-server
This allows the host machine to reach Docker containers by hostname, avoiding the issue posted by container IP addresses changing.
services:
dps:
image: defreitas/dns-proxy-server
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /etc/resolv.conf:/etc/resolv.conf
environment:
- MG_LOG_LEVEL=ERROR
hostname: dns.docker
nginx-marcd:
image: nginx
container_name: marcd.cc
restart: always
hostname: nginx-marcd.docker
volumes:
- /home/marc/hugo/marcd.cc/public:/usr/share/nginx/html:ro
- ./marcd.cc/default.conf:/etc/nginx/conf.d/default.conf
- ./marcd.cc/nginx.conf:/etc/nginx/nginx.conf
environment:
- VIRTUAL_HOST=marcd.cc,fji2bedq46nsfp4kdrxl4hsfj72wbdxjumzt5rx3upra7d47cm2abaid.onion
- LETSENCRYPT_HOST=marcd.cc
networks:
default:
external:
name: nginx
With this setup, host machine can ping container with nginx-marcd.docker.