Nginx proxy configuration for Dip infra services.
- Add a service to the application's
dip.yml.
infra:
nginx:
git: https://github.com/bibendi/dip-nginx.git- Add a network to the application's
docker-compose.yml.
networks:
nginx-net:
name: ${DIP_INFRA_NETWORK_NGINX}
external: trueWhere DIP_INFRA_NETWORK_NGINX is a special variable that is set by Dip.
- Add a
VIRTUAL_HOSTenvironment variable and thenginx-netnetwork to a Docker Compose service.
services:
app:
environment:
VIRTUAL_HOST: some.lvh.me
networks:
- default
- nginx-net- Start infra services.
dip infra up- Start the app
dip up- Send a request to the app
curl -L http://some.lvh.me- In case of a container to container communication use the following command:
# inside a container
curl -L http://host.docker.internal -H 'Host: some.lvh.me'