The certificates are on the server, not in the docker container.
cp /etc/letsencrypt/archive/b2bmarket.aidimme.es/privkey2.pem /etc/letsencrypt/live/b2bmarket.aidimme.es/privkey.pem
cp: cannot stat '/etc/letsencrypt/archive/b2bmarket.aidimme.es/privkey2.pem': No such file or directory
Where are these then?
Do you not have the archive there?
yes i have this in the docker container This are the old certificates. And the new ones are in the server . I get them for first time with the nginx.config the first time .
ls -l /etc/letsencrypt/live/b2bmarket.aidimme.es/
total 8
-rwxr-xr-x 1 root root 3574 Sep 14 11:47 fullchain.pem
-rwxr-xr-x 1 root root 1704 Sep 14 11:47 privkey.pem
That's the issue. Those are the September 4 certificates (copied on September 14). You need to replace those with the November 24 files (keeping the names as they are in the live folder).
how do i replace the documents from the server to the docker container?
How did the others get into the docker container?
This is the docker_setup and nginx config of my project.
In the file of nginx.config we have the path to the ssl certificate and key. This is the path. in my case:
ssl_certificate /etc/letsencrypt/live/b2bmarket.aidimme.es/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/b2bmarket.aidimme.es/privkey.pem;
I notice that the new certificates are in /archive/b2bmarket.aidimme.es so i change the path.
to
ssl_certificate /etc/letsencrypt /archive/b2bmarket.aidimme.es/fullchain3.pem;
ssl_certificate_key /etc/letsencrypt/archive/b2bmarket.aidimme.es/privkey3.pem;
i did certbot renew --force-renewal so i have cert3 and chain 3 now.
ls -l /etc/letsencrypt/live/b2bmarket.aidimme.es/
total 4
lrwxrwxrwx 1 root root 44 nov 25 10:42 cert.pem -> ../../archive/b2bmarket.aidimme.es/cert3.pem
lrwxrwxrwx 1 root root 45 nov 25 10:42 chain.pem -> ../../archive/b2bmarket.aidimme.es/chain3.pem
lrwxrwxrwx 1 root root 49 nov 25 10:42 fullchain.pem -> ../../archive/b2bmarket.aidimme.es/fullchain3.pem
lrwxrwxrwx 1 root root 47 nov 25 10:42 privkey.pem -> ../../archive/b2bmarket.aidimme.es/privkey3.pem
-rwxrwxrwx 1 root root 692 sep 4 09:54 README
But when i restart the container it have exited status.
logs of container: docekr logs id
2020/11/25 10:23:06 [emerg] 1#1: BIO_new_file("/etc/letsencrypt/archive/b2bmarket.aidimme.es/fullchain3.pem") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/archive/b2bmarket.aidimme.es/fullchain3.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
nginx: [emerg] BIO_new_file("/etc/letsencrypt/archive/b2bmarket.aidimme.es/fullchain3.pem") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/archive/b2bmarket.aidimme.es/fullchain3.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)
One colegue told me to coppy the certs to other directory and restart the container. I did it but got the same resoult :No such file or directory