docker icon indicating copy to clipboard operation
docker copied to clipboard

Missing configure HTTPS

Open murilopontes opened this issue 8 years ago • 2 comments

Docker image is missing HTTPS. Would be good use HTTPS by default

murilopontes avatar Mar 05 '17 00:03 murilopontes

I'm not so sure HTTPS should be handled at this level. You need to issue valid certificate to make it usable and I believe it's better to manage this centrally than in every Docker container which can do http.

There are dozens of https frontends doing this, for example https://hub.docker.com/r/steveltn/https-portal/

nijel avatar Mar 06 '17 09:03 nijel

I think we could do some think like this:

phpmyadmin:
    image: phpmyadmin/phpmyadmin
    volumes:
      - ./keys:/keys_directory
    environment:
      - PMA_HTTPS=1

First of all, use an environment variable to choose if HTTPS will be used or not. If the /keys_directory/server.{key,crt} doesn't exists, generate the keys as example:

openssl req -x509 \
            -nodes \
            -days 365 \
            -newkey rsa:2048 \
            -keyout /etc/nginx/ssl/server.key \
            -out /etc/nginx/ssl/server.crt

pgbezerra avatar Jun 26 '17 21:06 pgbezerra