2018-12-18 16:53:37 +03:00
|
|
|
{ pkgs, ... }:
|
|
|
|
{
|
2022-12-16 04:44:50 +03:00
|
|
|
project.name = "webapp";
|
|
|
|
services = {
|
2018-12-18 16:53:37 +03:00
|
|
|
|
|
|
|
webserver = {
|
2021-05-25 20:28:08 +03:00
|
|
|
image.enableRecommendedContents = true;
|
2018-12-18 16:53:37 +03:00
|
|
|
service.useHostStore = true;
|
|
|
|
service.command = [ "sh" "-c" ''
|
|
|
|
cd "$$WEB_ROOT"
|
|
|
|
${pkgs.python3}/bin/python -m http.server
|
|
|
|
'' ];
|
|
|
|
service.ports = [
|
|
|
|
"8000:8000" # host:container
|
|
|
|
];
|
|
|
|
service.environment.WEB_ROOT = "${pkgs.nix.doc}/share/doc/nix/manual";
|
2020-10-02 12:39:38 +03:00
|
|
|
service.stop_signal = "SIGINT";
|
2018-12-18 16:53:37 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|