Hacker News new | ask | show | jobs
by hbz 3687 days ago
I use 2 containers to accomplish this:

https://github.com/jwilder/nginx-proxy

https://github.com/JrCs/docker-letsencrypt-nginx-proxy-compa...

Since both are long running processes, it makes sense to keep them in separate containers.

2 comments

I had various issues with that combo, and also didn't like the repetition of VIRTUAL_HOST and LETSENCRYPT_HOST, so I combined the docker-gen and letsencrypt portion[1]. Still BYO nginx.

I also wrote a tool for deploying and managing static servers and application servers during development[2][3], but it's not ready for a Show HN yet. But the idea is ...

    b3cmd --project foo static-scaffold
    b3cmd --project foo static-put public/ /
... and you'll have a docker-compose project accessible at "foo--master.example.com" and a static server at "foo--master--static.example.com", all HTTPS ready.

[1]: https://github.com/mikew/docker-gen-letsencrypt

[2]: https://github.com/mikew/b3cmd

[3]: https://github.com/mikew/b3cmd-server

I just got exactly the same setup working this past week, after deciding to move from ad-hoc setup to a clean Dockerized setup with minimal custom config. It's great!

The thing I like about this setup is that it seamlessly supports multiple vhosts, including SNI for the SSL. I can just create a new container that serves a new domain and set a few environment variables (VIRTUAL_HOST=mydomain.com and LETSENCRYPT_HOST=mydomain.com) and within a few seconds there's a new cert and all requests on that domain are proxied appropriately.

My setup script is here [1] for anyone who wants to do the same.

[1] https://github.com/cfallin/dot/blob/master/doc/setup-grey.c1...