TLDR
My container letsencrypt folder contains:
accounts cli.ini csr keys renewal renewal-hooks
but NO live folder after attempting to mount the /etc/letsencrypt from my host machine.
This is what my host machine folder contains.
TEST.txt (generated by me) accounts archive live renewal renewal-hooks
This is my first time diving into ssl generation and deploying web servers on docker, my apologies for any rookie mistakes.
My domain is: cinema-testapp.uksouth.cloudapp.azure.com
I ran this command: certbot certonly on the host virtual machine, hoping to sync the keys to my webserver container using volumes.
It produced this output:
Succesful certificate generation. I wanted to mount the /etc/letsencrypt/ folder to my nginx web server container to use the certs there by creating volumes in my docker-compose.yml.
I started with a simple
frontend:
image: azurecr.io/cinema-frontend-image-azure
container_name: frontend
ports:
- "80:80"
- "443:443"
depends_on:
- backend
networks:
- cinema-app-network
volumes:
- /etc/letsencrypt/:/etc/letsencrypt/
Below is my latest attempt.
services:
frontend:
image: azurecr.io/cinema-frontend-image-azure
container_name: frontend
ports:
- "80:80"
- "443:443"
depends_on:
- backend
networks:
- cinema-app-network
volumes:
- letsencrypt:/nginx/letsencrypt
volumes:
letsencrypt:
driver: local
driver_opts:
type: none
device: /etc/letsencrypt
o: bind
networks:
cinema-app-network:
driver: bridge
This results in an a discrepancy between the contents of the folders on the container and on the host.
container ls result: accounts cli.ini csr keys renewal renewal-hooks
host ls result: TEST.txt (generated by me) accounts archive live renewal renewal-hooks
I was expecting (hoping) for the contents of both folders to be the same.
My web server is (include version): Nginx 1.23.3
The operating system my web server runs on is (include version): Debian 11 Nginx Container, but the certificate was generated on a Ubuntu 20.04 host VM.
My hosting provider, if applicable, is: Azure
I can login to a root shell on my machine (yes or no, or I don't know): yes
What is my mistake? Thanks a lot!