question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update docker-compose to use https

See original GitHub issue

It is necesarry to update in dev branch docker-compose for https scenario.

Good sample is provided from @bravecobra - https://github.com/bravecobra/identityserver-ui

I would like to use http://127.0.0.1.xip.io - with https for development scenario as well - but currently it does not work properly on my machine - I need spend more time on this.

Currently this feature is blocker for next release, because I would like to provide support for docker as well and https is required. Any help/PR is really welcome. 👍 🚀

Thanks

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:18 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
vpetkoviccommented, Jun 26, 2020

I think something along these lines could help and be a good start. Here’s the explanation of each container:

  • nginx-proxy will route traffic to other containers by providing “VIRTUAL_HOST” environment variable.

  • letsencrypt-nginx-proxy-companion will auto-generate valid SSL cert for virtual host. (Using self-signed certs might add complexity and additional config of nginx)

  • nginx will run demo web server

     services:
         nginx-proxy:
             container_name: nginx-proxy
             ports:
                 - "80:80"
                 - "443:443"
             volumes:
                 - /etc/nginx/certs
                 - /etc/nginx/vhost.d
                 - /usr/share/nginx/html
                 - "/var/run/docker.sock:/tmp/docker.sock:ro"
             image: jwilder/nginx-proxy
         
         letsencrypt-nginx-proxy-companion:
             container_name: nginx-proxy-letsencrypt
             volumes:
                 - "/var/run/docker.sock:/var/run/docker.sock:ro"
             environment:
                 - DEFAULT_EMAIL=PUTYOUREMAILHERE
             image: jrcs/letsencrypt-nginx-proxy-companion
         
         nginx:
             container_name: nginx
             environment:
                 - VIRTUAL_HOST=127.0.0.1.xip.io
                 - LETSENCRYPT_HOST=127.0.0.1.xip.io
             image: nginx
    

This part is not directly related to https but it is related to nginx (some might’ve experienced it) as it might cause 502 bad gateway when authorizing a client. It is due the fact that nginx doesn’t allow a large header content. To fix that nginx.conf needs to be modified and inlcude

    http{
        proxy_buffer_size   128k;
        proxy_buffers   4 256k;
        proxy_busy_buffers_size   256k;
        large_client_header_buffers 4 16k;
    }
1reaction
skorubacommented, Jul 18, 2020

Done - PR #657. Thanks for your help/suggestions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Install the Compose plugin
Download and install Docker Compose on Linux with this step-by-step handbook. This plugin can be installed manually or by using a repository.
Read more >
How to upgrade docker-compose to latest version
First, remove the old version: If installed via apt-get sudo apt-get remove docker-compose. If installed via curl
Read more >
Using HTTPS in docker for local development
Open a terminal and make a folder with name, say wordpress-with-https and move inside it. Now create a file with name docker-compose.yml and ......
Read more >
Updating a Container with Docker Compose - Tanner's Tech
To start, simply navigate to the directory of your container's docker compose file and run the command docker compose pull . Docker will...
Read more >
How To Install and Use Docker Compose on Ubuntu 20.04
In this guide, you'll demonstrate how to install Docker Compose on an Ubuntu 20.04 server and how to get started using this tool....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found