Skip to content

Instantly share code, notes, and snippets.

@nonamenix
Created April 19, 2017 21:01
Show Gist options
  • Save nonamenix/0f3c8abb1d4b8d03d847ff44cb5c6448 to your computer and use it in GitHub Desktop.
Save nonamenix/0f3c8abb1d4b8d03d847ff44cb5c6448 to your computer and use it in GitHub Desktop.
How to run your pet project with nginx + letsencrypt + condo
{
:spec {
:Name "letsencrypt_companion"
:Image "jrcs/letsencrypt-nginx-proxy-companion"
:HostConfig {
:Env [
"NGINX_PROXY_CONTAINER=nginx_proxy"
]
:Binds [
"/var/run/docker.sock:/var/run/docker.sock:ro"
"/etc/nginx/certs:/etc/nginx/certs:rw"
]
:VolumesFrom [
"nginx_proxy:rw"
]
:NetworkMode "petprojects_default"
}
}
:health-timeout 45
}
{
:spec {
:Name "nginx_proxy"
:Image "jwilder/nginx-proxy:0.4.0"
:Env ["DEFAULT_HOST=whoami"]
:HostConfig {
:Binds [
"/var/run/docker.sock:/tmp/docker.sock:ro"
"/etc/nginx/certs:/etc/nginx/certs:ro"
]
:PortBindings {
"80/tcp" [{:HostPort "80"}]
"443/tcp" [{:HostPort "443"}]
}
:NetworkMode "petprojects_default"
}
:Volumes {
"/etc/nginx/vhost.d" { }
"/usr/share/nginx/html" { }
}
}
}
{
:spec {
:Name "whoami"
:Image "jwilder/whoami"
:Env [
"VIRTUAL_HOST=whoami.nonamenix.ru"
"VIRTUAL_PORT=8000"
"LETSENCRYPT_HOST=whoami.nonamenix.ru"
"[email protected]"
]
:HostConfig {
:RestartPolicy {:Name "always"}
:NetworkMode "petprojects_default"
}
}
:health-timeout 45
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment