Add webserver service

This commit is contained in:
Tristan Daniël Maat 2021-04-12 01:44:10 +01:00
parent 98cf95a922
commit 40002ac76e
Signed by: tlater
GPG key ID: 49670FD774E43268
4 changed files with 170 additions and 4 deletions
configuration/services

View 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" ];
};
}