Hello,
I'm trying to set up lets encrypt on my server, but I'm running into a weird issue. I'm running the two docker containers, and they seem work correctly
I have the following shell script called www.sh, which basically just starts up a nginx container and mounts the $PWD/docker_data folder to the html path. This seems to work correctly, and i can go to https://jelly.mydomain.com and I dont get any issues
#!/bin/bash
docker run \
--name www-proxy \
--env "VIRTUAL_HOST=jelly.mydomain.com" \
--env "LETSENCRYPT_HOST=jelly.mydomain.com" \
--env "LETSENCRYPT_EMAIL=info@mydomain.com" \
-v $PWD/docker_data:/usr/share/nginx/html:ro \
nginx
But, I tried to set up the exact same call, but using a docker-compose file below. Now when i go to https://jelly.mydomain.com i keep getting a BAD GATEWAY ERROR.
docker-compose.yml
version: '3.3'
services:
nginx:
volumes:
- "$PWD/docker_data:/usr/share/nginx/html:ro"
environment:
- VIRTUAL_HOST=jelly.mydomain.com
- LETSENCRYPT_HOST=jelly.mydomain.com
- LETSENCRYPT_EMAIL=info@mydomain.com
container_name: www-proxy
image: nginx
If I then shutdown the docker-compose run and run the shell script again, everything seem to work. Am I missing something here? Why does calling the docker run... command seem to work but the docker-compose not? If I docker exec .... /bin/bash into the containers, and call a curl localhost, both are serving the correct page.
Hello,
I'm trying to set up lets encrypt on my server, but I'm running into a weird issue. I'm running the two docker containers, and they seem work correctly
I have the following shell script called
www.sh, which basically just starts up a nginx container and mounts the$PWD/docker_datafolder to the html path. This seems to work correctly, and i can go tohttps://jelly.mydomain.comand I dont get any issuesBut, I tried to set up the exact same call, but using a docker-compose file below. Now when i go to
https://jelly.mydomain.comi keep getting a BAD GATEWAY ERROR.docker-compose.yml
If I then shutdown the docker-compose run and run the shell script again, everything seem to work. Am I missing something here? Why does calling the
docker run...command seem to work but thedocker-composenot? If Idocker exec .... /bin/bashinto the containers, and call acurl localhost, both are serving the correct page.