简体   繁体   中英

docker-compose volumes not works

I have this docker-compose.yml

  client:
    build:
      context:  ./client
      dockerfile: Dockerfile
    ports:
      - "80:80"
      - "443:443" 
    volumes:
       - /etc/letsencrypt:/etc/letsencrypt

Also I have nginx.conf that is supposed to be proxy to client. Everything is good. Also I've set up ssl on host nginx - that is working as expected.

Now I want to use ssl in client-prox-nginx - it's inside docker. I've copied nginx generated from certbot to docker nginx and it is not working.

So - with same nginx setup as host, docker nginx is not encrypting with ssl. I suspect that it is because docker can't access letsencrypt folder. Are "volumes" in docker-compose correct? How can I test that?

I know that nginx.conf is correct - it is copy of nginx.conf from host that is working perfectly.

Simply put - docker can't access localhost files. I used volumes and it not working.

So per night-gold comment, I've connected to container. Files (ssl certs) are accessible from there. But still ssl is not working. I will post another question. Hosts are working as expected, I'm layman in docker.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM