Bind mounts and how to debug problems

I got this project started by a long gone coworker that’s in a docker container. I didn’t have prior knowledge to docker before it, but it has been working fine since then. But after I got my mac m1 I had to redo it a bit in order to make it compatible and I’ve got everything running except making it work on SSL.

It is a nginx + php project. I got well over a decade of experience with apache, so I’m new to nginx as well.

However, to my question.

The docker-compose.yml lists this image with some bind volumes. But nginx doesn’t seem to be able to read the SSL certificates and I’m just wondering how I can access them to debug what’s gone wrong.

Lets take the relevant snippets from the file:

    image: nginx:latest
    - "80:80"
    - "443:443"
      - ./api:/api
      - ./sites.conf:/etc/nginx/conf.d/sites.conf
      - ./nginx.conf:/etc/nginx/nginx.conf
      - ./snippets/self-signed.conf:/etc/nginx/snippets/self-signed.conf
      - ./snippets/ssl-params.conf:/etc/nginx/snippets/ssl-params.conf
      - ./ssl/dhparam.pem:/etc/ssl/dhparam.pem
      - ./ssl/nginx-selfsigned.crt:/etc/ssl/nginx-selfsigned.crt
      - ./ssl/nginx-selfsigned.key:/etc/ssl/nginx-selfsigned.key

It complain about not being able to access the /etc/ssl/nginx-selfsigned.key at the appropriate time. And when I log into the volume, I can’t see it either but I can’t see any of the other bind-volumes either. But they are apparently there because I can access it using the browser.

I quoted what happened when I tried in my other question in the mac forum,

So in my venture to see what the problem was, I disabled the loading of the certification and tried to log in to get it working. But ran into the problem of understanding how to actually do it.

I m not sure what this new topic adds to the question. In the other topic the only problem I could see is the wrong permissions, but there you wrote you could see the certificate in the container and you also quoted how you checked it. Now you say:

What volume? Do you mean container?

What exactly do you see from the browser? The certificate? Or the API

By the way, where is your PHP container? I only see nginx.

it was indeed the permissions. I just put it to read for all since it’s just a local certificate. tried to get it to use the same user id as the host, but it was more of a hassle than it was worth.

regarding volume.
- ./foo:/foo

i was wondering how to access that. but later I have realized using docker run wasn’t mounting it. so doing a docker-compose exec gave me the right setup.