tiangolo / dockerswarm.rocks

Docker Swarm mode rocks! Ideas, tools and recipes. Get a production-ready, distributed, HTTPS served, cluster in minutes, not weeks.
https://dockerswarm.rocks/
1.09k stars 126 forks source link

Not getting ssl #38

Closed raphawa closed 3 years ago

raphawa commented 4 years ago

I'm trying to setup wordpress stack behind the traefik in docker swarm but not allways get ssl error and can't access website.

here is my compose file

version: '3'

networks:
  traefik-public:
    external: true
  internalwp:
    external: false

services:
 wordpress:
  image: wordpress:5.4.1-php7.2-apache
  depends_on:
  - mariadb
  volumes:
  - orgwerimawp:/var/www/html/wp-content
  environment:
   WORDPRESS_DB_HOST: xxxxxxxxxxxxxxxxxxxxxxxxxx
   WORDPRESS_DB_PASSWORD: xxxxxxxxxxxxxxxxxx
   WORDPRESS_DB_USER: xxxxxxxxxxxxxxxxxxxxx
   WORDPRESS_DB_NAME: xxxxxxxxxxxxxxxxxxxxxxxxx
   WORDPRESS_CONFIG_EXTRA: |
        /* Multisite */
        define('WP_ALLOW_MULTISITE', true );
        define('MULTISITE', true);
        define('SUBDOMAIN_INSTALL', true);
        define('DOMAIN_CURRENT_SITE', 'exempl.com'); // TODO: change to actual domain when deploying
        define('PATH_CURRENT_SITE', '/');
        define('SITE_ID_CURRENT_SITE', 1);
        define('BLOG_ID_CURRENT_SITE', 1);

  deploy:
      placement:
        constraints:
          - node.role == worker
  labels:
        - traefik.frontend.rule=Host: exempl.com
        - traefik.enable=true
        - traefik.port=80
        - traefik.tags=traefik-public
        - traefik.docker.network=traefik-public
        - traefik.frontend.entryPoints=http,https
        - traefik.frontend.redirect.entryPoint=https
  networks:
    - traefik-public
    - internalwp

 mariadb:
  image: mariadb:10.5.3
  volumes:
  - orgdb:/var/lib/mysql
  environment:
   MYSQL_ROOT_PASSWORD: xxxxxxxxxxxxxxxxxx
   MYSQL_DATABASE: xxxxxxxxxxxxxxxxx
   MYSQL_USER: xxxxxxxxxxxxxxx
   MYSQL_PASSWORD: xxxxxxxxxxxxxxxxxx  
  restart: always
  deploy:
      placement:
        constraints:
          - node.role == worker    
  networks:
    - internalwp
  labels:
      - traefik.enable=false

volumes:
   orgwp: 
   orgdb:
tiangolo commented 4 years ago

Hey @raphawa I just updated all the docs yesterday using Traefik v2.

Maybe you can check if using the new version and re-using the new instructions works better for you.

Also, see how I edited your comment to show the YAML file with proper formatting which makes it easier to read and understand.

raphawa commented 4 years ago

Thanks for. I've deployed using version 2 but still not getting ssl certificates for domain just used the corrected yaml file. The stack is fully deployed but no ssl and redirect to 404 error

Midnighter commented 4 years ago

@tiangolo does the example fully work for you? I have not been able to get Let's Encrypt certificates using the TLS challenge, however, I do succeed with the HTTP challenge and then everything works as expected.

raphawa commented 4 years ago

It didn't work !

On Sat, Jul 4, 2020, 10:32 AM Moritz E. Beber notifications@github.com wrote:

@tiangolo https://github.com/tiangolo does the example fully work for you? I have not been able to get Let's Encrypt certificates using the TLS challenge, however, I do succeed with the HTTP challenge and then everything works as expected.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tiangolo/dockerswarm.rocks/issues/38#issuecomment-653773149, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOFLB27IJ6LPGN26NM3NRF3RZ44RRANCNFSM4NIUQZAA .

tiangolo commented 4 years ago

Great! Thanks for reporting @raphawa . I'll then close this issue now. :heavy_check_mark:

Midnighter commented 4 years ago

It didn't work !

Didn't or did work?

tiangolo commented 3 years ago

Ah! Sorry, I probably read that incorrectly :facepalm:

Did it work @raphawa ?

github-actions[bot] commented 3 years ago

Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues.