feat: adding nix docker image recipe

This commit is contained in:
efim 2023-09-27 04:49:48 +00:00
parent 9edf7f0196
commit 2070bbebb0
2 changed files with 19 additions and 3 deletions

View File

@ -1,7 +1,6 @@
{ pkgs, lib, sbt-derivation }:
let
pname = "countries-page";
in {
let pname = "countries-page";
in rec {
package = sbt-derivation.lib.mkSbtDerivation {
inherit pkgs pname;
# ...and the rest of the arguments
@ -19,4 +18,20 @@ in {
depsSha256 = "sha256-vdCU7UJAGi/CujA05OVw/lIomMpIFl+kW+pn8ny16JI=";
};
image = pkgs.dockerTools.buildLayeredImage {
name = pname;
tag = "latest";
created = "now";
config = {
Cmd = [
"${pkgs.jdk}/bin/java"
"-jar"
"${package}/bin/${pname}.jar"
"--host"
"0.0.0.0"
];
ExposedPorts = { "8080/tcp" = { }; };
};
};
}

View File

@ -63,6 +63,7 @@
packages.multi-step-form-image = multi-step-form.image;
nixosModules.multi-step-form = multi-step-form.module;
packages.flag-page = flags-page.package;
packages.flag-page-image = flags-page.image;
});
# see https://serokell.io/blog/practical-nix-flakes
}