Add webserver service
This commit is contained in:
parent
98cf95a922
commit
40002ac76e
4 changed files with 170 additions and 4 deletions
configuration
|
@ -1,7 +1,8 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [ ./services/gitea.nix ./services/nextcloud.nix ];
|
||||
imports =
|
||||
[ ./services/gitea.nix ./services/nextcloud.nix ./services/webserver.nix ];
|
||||
|
||||
nix = {
|
||||
package = pkgs.nixFlakes;
|
||||
|
@ -53,6 +54,7 @@
|
|||
locations."/" = { proxyPass = "http://localhost:${toString port}"; };
|
||||
} // extra;
|
||||
in {
|
||||
"tlater.net" = host 3002 { serverAliases = [ "www.tlater.net" ]; };
|
||||
"gitea.tlater.net" = host 3000 { };
|
||||
"nextcloud.tlater.net" = host 3001 { };
|
||||
};
|
||||
|
|
27
configuration/services/webserver.nix
Normal file
27
configuration/services/webserver.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
virtualisation.oci-containers.containers.webserver = {
|
||||
image = "tlaternet/webserver";
|
||||
|
||||
imageFile = pkgs.dockerTools.buildImage {
|
||||
name = "tlaternet/webserver";
|
||||
tag = "latest";
|
||||
contents = pkgs.tlaternet-webserver.webserver;
|
||||
|
||||
config = {
|
||||
Cmd = [ "tlaternet-webserver" ];
|
||||
Volumes = { "/srv/mail" = { }; };
|
||||
Env = [
|
||||
"ROCKET_PORT=80"
|
||||
"ROCKET_TEMPLATE_DIR=${pkgs.tlaternet-templates.templates}/browser/"
|
||||
];
|
||||
ExposedPorts = { "80" = { }; };
|
||||
};
|
||||
};
|
||||
|
||||
ports = [ "3002:80" ];
|
||||
volumes = [ "tlaternet-mail:/srv/mail" ];
|
||||
extraOptions = [ "--hostname=tlater.net" ];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue