2019-01-28 15:50:31 +01:00
|
|
|
{ ... } @ args:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
in args // {
|
2019-02-03 12:58:56 +01:00
|
|
|
config = { config, pkgs, ... }: {
|
2019-02-03 11:58:07 +01:00
|
|
|
imports = [
|
2019-02-03 14:31:21 +01:00
|
|
|
../profiles/containers/configuration.nix
|
2019-02-03 11:58:07 +01:00
|
|
|
];
|
|
|
|
|
2019-01-28 15:50:31 +01:00
|
|
|
networking.firewall.enable = false;
|
|
|
|
|
2019-02-03 11:58:07 +01:00
|
|
|
services.ddclientovh = {
|
|
|
|
enable = true;
|
|
|
|
domain = "www.stefanjunker.de";
|
|
|
|
};
|
|
|
|
|
2019-02-03 12:58:56 +01:00
|
|
|
services.nginx.enable = true;
|
|
|
|
services.nginx.virtualHosts."stefanjunker.de" = {
|
|
|
|
default = true;
|
|
|
|
onlySSL = true;
|
|
|
|
root = "/var/www/stefanjunker.de/htdocs";
|
2019-01-28 15:50:31 +01:00
|
|
|
|
2019-02-03 12:58:56 +01:00
|
|
|
sslCertificate = "/etc/secrets/stefanjunker.de/nginx/nginx.crt";
|
|
|
|
sslCertificateKey = "/etc/secrets/stefanjunker.de/nginx/nginx.key";
|
|
|
|
|
|
|
|
locations."/fi" = {
|
|
|
|
index = "index.php";
|
2019-01-28 15:50:31 +01:00
|
|
|
};
|
2019-02-03 12:58:56 +01:00
|
|
|
|
|
|
|
locations."~ ^(.+\.php)(.*)$".extraConfig = ''
|
|
|
|
fastcgi_split_path_info ^(.+\.php)(.*)$;
|
|
|
|
|
|
|
|
fastcgi_pass 127.0.0.1:9000;
|
|
|
|
fastcgi_index index.php;
|
2019-01-28 15:50:31 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2019-02-03 12:58:56 +01:00
|
|
|
services.phpfpm.phpPackage = pkgs.php56;
|
|
|
|
|
|
|
|
services.phpfpm.poolConfigs.mypool = ''
|
|
|
|
listen = 127.0.0.1:9000
|
|
|
|
user = nobody
|
|
|
|
pm = dynamic
|
|
|
|
pm.max_children = 5
|
|
|
|
pm.start_servers = 2
|
|
|
|
pm.min_spare_servers = 1
|
|
|
|
pm.max_spare_servers = 3
|
|
|
|
pm.max_requests = 500
|
|
|
|
|
|
|
|
php_admin_value[error_reporting] = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED
|
|
|
|
'';
|
|
|
|
|
|
|
|
services.mysql = {
|
2019-01-28 15:50:31 +01:00
|
|
|
enable = true;
|
2019-02-03 12:58:56 +01:00
|
|
|
package = pkgs.mariadb;
|
2019-01-28 15:50:31 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
autoStart = true;
|
|
|
|
|
|
|
|
bindMounts = {
|
2019-02-03 12:58:56 +01:00
|
|
|
"/etc/secrets/" = {
|
|
|
|
hostPath = "/var/lib/container-volumes/webserver/etc-secrets";
|
|
|
|
isReadOnly = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
"/var/www" = {
|
|
|
|
hostPath = "/var/lib/container-volumes/webserver/var-www";
|
2019-01-28 15:50:31 +01:00
|
|
|
isReadOnly = false;
|
|
|
|
};
|
|
|
|
|
2019-02-03 12:58:56 +01:00
|
|
|
"/var/lib/mysql" = {
|
|
|
|
hostPath = "/var/lib/container-volumes/webserver/var-lib-mysql";
|
|
|
|
isReadOnly = false;
|
|
|
|
};
|
2019-01-28 15:50:31 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
privateNetwork = true;
|
|
|
|
forwardPorts = [
|
|
|
|
{
|
2019-02-03 12:58:56 +01:00
|
|
|
# https
|
2019-01-28 15:50:31 +01:00
|
|
|
containerPort = 443;
|
|
|
|
hostPort = 443;
|
|
|
|
protocol = "tcp";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|