aspendigital / docker-octobercms

Dockerized October CMS: PHP, Composer, October core and dependencies
MIT License
150 stars 54 forks source link

Help add ssl #20

Closed uitlaber closed 5 years ago

uitlaber commented 5 years ago

Please give any example to add ssl for domains

uitlaber commented 5 years ago

Find it, but not work

docker run -d --name apache-ssl birgerk/apache-letsencrypt
UPDATED_DOMAINS="example.org,more.example.org"
docker exec -it apache-ssl /run_letsencrypt.sh --domains $UPDATED_DOMAINS
petehalverson commented 5 years ago

There are a variety of ways to do this. Here's a docker-compose.yml example using a Traefik and Let's Encrypt:


version: '3.7'
services:
  proxy:
    image: traefik:1.7
    command: --docker \
        --acme \
        --acme.storage=acme.json \
        --acme.entryPoint=https \
        --acme.httpChallenge.entryPoint=http \
        --acme.email=email@domain.tld \
        --entrypoints='Name:http Address::80 Redirect.EntryPoint:https' \
        --entrypoints='Name:https Address::443 TLS' \
        --defaultentrypoints=http,https
    ports:
      - 80:80
      - 443:443
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./acme.json:/acme.json

  web:
    image: aspendigital/octobercms:latest
    labels:
      - "traefik.frontend.rule=Host:domain.tld"```