Container build support
This commit is contained in:
parent
c793b17bed
commit
0f6dcbab1c
26
flake.nix
26
flake.nix
@ -5,6 +5,10 @@
|
|||||||
parts.url = "github:hercules-ci/flake-parts";
|
parts.url = "github:hercules-ci/flake-parts";
|
||||||
};
|
};
|
||||||
outputs = inputs@{ self, nixpkgs, parts, ... }:
|
outputs = inputs@{ self, nixpkgs, parts, ... }:
|
||||||
|
let
|
||||||
|
packageName = "sampu";
|
||||||
|
containerPackageName = "${packageName}-container";
|
||||||
|
in
|
||||||
parts.lib.mkFlake { inherit inputs; } {
|
parts.lib.mkFlake { inherit inputs; } {
|
||||||
systems = nixpkgs.lib.systems.flakeExposed;
|
systems = nixpkgs.lib.systems.flakeExposed;
|
||||||
imports = [ inputs.haskell-flake.flakeModule ];
|
imports = [ inputs.haskell-flake.flakeModule ];
|
||||||
@ -22,6 +26,28 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
packages.${containerPackageName} = pkgs.dockerTools.buildImage {
|
||||||
|
name = packageName;
|
||||||
|
|
||||||
|
copyToRoot = pkgs.buildEnv {
|
||||||
|
name = "image-root";
|
||||||
|
paths = [ (pkgs.haskell.lib.justStaticExecutables self'.packages.sampu) ];
|
||||||
|
pathsToLink = [ "/bin" ];
|
||||||
|
};
|
||||||
|
tag = "latest";
|
||||||
|
config = {
|
||||||
|
Cmd = [
|
||||||
|
"/bin/sampu"
|
||||||
|
];
|
||||||
|
WorkingDir = "/app";
|
||||||
|
ExposedPorts = {
|
||||||
|
"3000/tcp" = {};
|
||||||
|
};
|
||||||
|
extraCommands = ''
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
packages.default = self'.packages.sampu;
|
packages.default = self'.packages.sampu;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -11,7 +11,7 @@ baseDoc title bodyContent = doctypehtml_ $ do
|
|||||||
head_ $ do
|
head_ $ do
|
||||||
title_ $ fromString title
|
title_ $ fromString title
|
||||||
link_ [rel_ "stylesheet", type_ "text/css", href_ "/style.css"]
|
link_ [rel_ "stylesheet", type_ "text/css", href_ "/style.css"]
|
||||||
script_ [src_ "/htmx.min.js"] none
|
-- script_ [src_ "/htmx.min.js"] none
|
||||||
body_ bodyContent
|
body_ bodyContent
|
||||||
|
|
||||||
baseNav :: Html ()
|
baseNav :: Html ()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user