This commit is contained in:
Robin Appelman 2023-11-25 00:31:32 +01:00
commit 3ffcb664d2
2 changed files with 29 additions and 3 deletions

View file

@ -27,7 +27,7 @@
pkgs = (import nixpkgs) {
inherit system overlays;
};
inherit (pkgs) lib callPackage;
inherit (pkgs) lib callPackage dockerTools;
src = lib.sources.sourceByRegex ./. ["Cargo.*" "(src|build|images|script|style)(/.*)?" "sqlx-data.json"];
nodeSrc = lib.sources.sourceByRegex ./. ["package.*"];
@ -51,6 +51,24 @@
'';
nativeBuildInputs = with pkgs; [pkg-config openssl];
};
docker = dockerTools.buildLayeredImage {
name = "demostf/frontend";
tag = "latest";
maxLayers = 5;
contents = [
frontend
];
config = {
Cmd = ["frontend"];
ExposedPorts = {
"80/tcp" = {};
};
Env = [
"LISTEN_ADDRESS=0.0.0.0"
"LISTEN_PORT=80"
];
};
};
};
devShells.default = pkgs.mkShell {
OPENSSL_NO_VENDOR = 1;