BirgerK / docker-apache-letsencrypt

This docker-image contains a simple Apache webserver and supports https-encryption by great Let's Encrypt certificates!
68 stars 47 forks source link

letsencrypt is never initialized #14

Open koo5 opened 3 years ago

koo5 commented 3 years ago
*** Running /etc/my_init.d/init_letsencrypt.sh...
*** Booting runit daemon...
*** Runit started as PID 26

/etc/letsencrypt contains cli.ini, so this check:

if ([ ! -d $LETSENCRYPT_HOME ] || [ ! "$(ls -A $LETSENCRYPT_HOME)" ]) && [ ! -z "$DOMAINS" ]; then
  /run_letsencrypt.sh --domains $DOMAINS
fi

fails?

rckvwijk commented 3 years ago

Wondering the same, i've filled the domain ENV but it is not generating the certificates.

koo5 commented 3 years ago

fwiw: i have two people independently using this or a similar setup and happy with it, but to be honest, after reviewing this and similar options, ..well, it's all such a kludge, right? So then i figured out there's also Caddy and Traefik. I'm not so excited about caddy so far - doesn't support older protocols, it takes some time and confusion to realized that you have to learn the more verbose json config syntax to achieve what you need.. But hey, when it works, it's about 5 config file lines and 8 lines in docker-compose.yml and everything's automated - i put it in front of apache that does the dispatching etc, caddy's there just for the ssl. I'm going to try out Traefik next..

Not to diminish the value of good old battle-tested Free Software though! Just saying where the crowd probably went..

rckvwijk commented 3 years ago

Ah that sounds good, got any code examples?

koo5 commented 3 years ago

docker-stack.yml:

version: '3.7'
services:
  caddy:
    image: caddy:2.3.0-alpine
    networks:
      - frontend
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./caddy/Caddyfile:/etc/caddy/Caddyfile
      - caddy_data:/data
      - caddy_config:/config

  apache:
...

Caddyfile:

{
  debug
}
localhost
reverse_proxy apache