smart
smart

Reputation: 2065

Lets encrypt in nginx docker container

I'm new on Let's encrypt and I want to use it in pair with my docker containers.

I'm also using nginx.

My nginx's Docker file looks like:

FROM nginx:1.13
RUN apt-get update && apt-get install -y git-core
RUN git clone https://github.com/letsencrypt/letsencrypt
RUN yes | ./letsencrypt/certbot-auto certonly --standalone --agree-tos --non-interactive --email [email protected] -d stage.timebarter.co
RUN rm /etc/nginx/conf.d/default.conf

But it says that:

The server could not connect to the client to verify the domain :: Fetching http://stage.timebarter.co/.well-known/acme-challenge/Sx7Km48vhi-SJlYdLhDbbKSiLL9Bdj_PoylnDt0Dl_A: Connection refused

I was googling this problem and found that it might be related to manual (certonly, standalone mode).

I was also trying to run:

RUN yes | ./letsencrypt/certbot-auto --agree-tos --non-interactive --email [email protected] -d stage.timebarter.co

And the same problem is here:

urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Fetching http://stage.timebarter.co/.well-known/acme-challenge/0Mv3aEpm5HAEwLfPkFTEhH4u74hnzgeGyHGMPV9570I: Connection refused

So, where I've made something wrong? Because I hope it should be very easy to add this Let's encrypt certificates for HTTPs support.

Upvotes: 2

Views: 733

Answers (1)

juanlumn
juanlumn

Reputation: 7135

Have you considered using the Letsencrypt container hosted in dockerhub?

From the documentation:

This container sets up an Nginx webserver and reverse proxy with php support and a built-in letsencrypt client that automates free SSL server certificate generation and renewal processes. It also contains fail2ban for intrusion prevention.

Upvotes: -1

Related Questions