G
G
Greg Popov2018-04-26 11:38:49
Digital certificates
Greg Popov, 2018-04-26 11:38:49

Simple SLL example for docker-compose?

I generated a compose file for myself, and a question arose. What is the easiest way to sign all this with a letsencrypt certificate.
Googled, did not find anything simple, only the option to rebuild the compose file. Passing councils on a config are welcomed.

###############################################################################
#                          Generated on phpdocker.io                          #
###############################################################################
version: "3.1"
services:

    mysql:
      image: mysql:5.6
      container_name: mysql-cont
      working_dir: /application
      volumes:
        - ./dbdata:/var/lib/mysql
      environment:
        - MYSQL_ROOT_PASSWORD=root_pass
        - MYSQL_DATABASE=db
        - MYSQL_USER=user
        - MYSQL_PASSWORD=passw
      ports:
        - "10002:3306"

    webserver:
      image: nginx:alpine
      container_name: webserver-cont
      working_dir: /application
      volumes:
          - .:/application
          - ./phpdocker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
      ports:
       - "10001:80"
      depends_on:
       - php-fpm

    php-fpm:
      build: phpdocker/php-fpm
      container_name: php-fpm-cont
      working_dir: /application
      volumes:
        - .:/application
        - ./phpdocker/php-fpm/php-ini-overrides.ini:/etc/php/7.2/fpm/conf.d/99-overrides.ini
      depends_on:
        - mysql

server {
    listen 80 default;

    client_max_body_size 108M;

    access_log /var/log/nginx/application.access.log;


    root /application/public;
    index index.php;

    if (!-e $request_filename) {
        rewrite ^.*$ /index.php last;
    }

    location ~ \.php$ {
        fastcgi_pass php-fpm:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PHP_VALUE "error_log=/var/log/nginx/application_php_errors.log";
        fastcgi_buffers 16 16k;
        fastcgi_buffer_size 32k;
        include fastcgi_params;
    }
    
}

Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Nesmeyanov, 2018-04-26
@SerafimArts

composer create-project kelunik/acme-client
php vendor/bin/acme auto

https://github.com/kelunik/acme-client
_ the certificate is bound to the domain.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question