Skip to content

Commit

Permalink
add a container image
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Nov 4, 2020
1 parent 7a69774 commit 2ae4cd9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion default.nix
Expand Up @@ -3,7 +3,7 @@ let
sources = import nix/sources.nix;
pkgs = import sources.nixpkgs { };
gitignore = import sources.gitignore { };
in {
in rec {
elo-anything = pkgs.stdenv.mkDerivation {
name = "elo-anything";
src = gitignore.gitignoreSource ./.;
Expand All @@ -26,4 +26,16 @@ in {
mv dist $out/share/elo-anything
'';
};

container = let
linuxPkgs = import sources.nixpkgs { system = "x86_64-linux"; };
listenPort = "80";
in linuxPkgs.dockerTools.buildLayeredImage {
name = "elo-anything";
contents = linuxPkgs.darkhttpd;
config = {
Cmd = [ "darkhttpd" "${elo-anything}/share/elo-anything" ];
ExposedPorts = { "${listenPort}/tcp" = { }; };
};
};
}

0 comments on commit 2ae4cd9

Please sign in to comment.