2020-02-08 12:27:41 +00:00
|
|
|
{ ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
networked-docker-containers = {
|
|
|
|
nginx-proxy = {
|
|
|
|
image = "jwilder/nginx-proxy:alpine";
|
|
|
|
ports = [
|
|
|
|
"80:80"
|
|
|
|
"443:443"
|
|
|
|
];
|
|
|
|
volumes = [
|
2020-07-13 21:42:43 +01:00
|
|
|
"${./configs/nginx-proxy.conf}:/etc/nginx/conf.d/general.conf:ro"
|
2020-02-08 12:27:41 +00:00
|
|
|
# So that we can watch new containers come up
|
|
|
|
"/var/run/docker.sock:/tmp/docker.sock:ro"
|
|
|
|
# So that we can access generated certs
|
|
|
|
"nginx-certs:/etc/nginx/certs:ro"
|
|
|
|
# So that we can write challenge files for letsencrypt auth
|
|
|
|
"nginx-challenges:/usr/share/nginx/html"
|
|
|
|
# So that we can modify config on-the-fly to set up challenge
|
|
|
|
# files
|
|
|
|
"nginx-conf:/etc/nginx/vhost.d"
|
|
|
|
];
|
|
|
|
environment = {
|
|
|
|
DHPARAM_GENERATION = "false"; # Provided by nginx-proxy-letsencrypt
|
|
|
|
};
|
|
|
|
networks = [
|
|
|
|
"webproxy"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
nginx-proxy-letsencrypt = {
|
|
|
|
image = "jrcs/letsencrypt-nginx-proxy-companion";
|
2020-07-13 21:39:31 +01:00
|
|
|
dependsOn = ["nginx-proxy"];
|
2020-02-08 12:27:41 +00:00
|
|
|
volumes = [
|
|
|
|
"/var/run/docker.sock:/var/run/docker.sock:ro"
|
|
|
|
"nginx-certs:/etc/nginx/certs"
|
|
|
|
];
|
|
|
|
environment = {
|
|
|
|
DEFAULT_EMAIL = "tm@tlater.net";
|
|
|
|
};
|
|
|
|
extraDockerOptions = [
|
|
|
|
"--volumes-from"
|
|
|
|
"nginx-proxy"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|