co bych udelal ja tak je:
1) docker network create -d bridge nginx-proxy
2) v tom tvym docker-compose definovat tu sit takto:
networks:
default:
external:
name: nginx-proxy
a ten tvuj network_mode neuvadet.
pak v aplikacnim docker-compose mam:
version: "2.1"
services:
php:
image:...
networks:
- net
nginx:
image:...
environment:
VIRTUAL_HOST: "${DOMAIN}"
VIRTUAL_PROTO: "${VIRTUAL_PROTO}"
VIRTUAL_PORT: "${VIRTUAL_PORT}"
VIRTUAL_NETWORK: nginx-proxy
LETSENCRYPT_HOST: "${LETSENCRYPT_HOST}"
LETSENCRYPT_EMAIL: "${LETSENCRYPT_EMAIL}"
networks:
- net
- nginx-proxy
networks:
nginx-proxy:
external:
name: nginx-proxy
net:
driver: bridge
ty promenny z .env asi chapes. je tam toho vic jako DB apod, vse v siti s nazvem net. volumes apod tady ted neresim
domain muze byt carkama oddelenych vic domen
BTW asi bych si dal u techto kontejneru restart: always