In my app.yml, make these changes:
Only expose port 80:
expose:
- "80" # fwd host port 80 to container port 80 (http)
In the env:
section, add the latter 3 new lines:
DISCOURSE_HOSTNAME: 'a.com'
VIRTUAL_HOST: 'a.com'
LETSENCRYPT_HOST: 'a.com'
LETSENCRYPT_EMAIL: a@a.com'
Then run ./launer rebuild app
and my docker-compose.yml looks:
version: '2'
services:
nginx:
image: nginx
volumes:
- "./etc/nginx/conf.d/:/etc/nginx/conf.d/"
environment:
VIRTUAL_HOST: a.com
LETSENCRYPT_HOST: a.com
LETSENCRYPT_EMAIL: a@a.com
nginx-proxy:
image: jwilder/nginx-proxy
ports:
- "80:80"
- "443:443"
volumes:
- "./nginx/vhost.d:/etc/nginx/vhost.d"
- "./nginx/html:/usr/share/nginx/html"
- "./nginx/certs:/etc/nginx/certs"
- "/var/run/docker.sock:/tmp/docker.sock:ro"
letsencrypt-nginx-proxy-companion:
image: jrcs/letsencrypt-nginx-proxy-companion
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
volumes_from:
- "nginx-proxy"
Then i run docker-compose up,when i visit a.com
,i got 502.
Waitting for help