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: true
Where DIP_INFRA_NETWORK_NGINX
is a special variable that is set by Dip.
- Add a
VIRTUAL_HOST
environment variable and thenginx-net
network 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'