diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..971fbd3 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +.direnv/ +.git/ +.github/ +.pub/ +result +update-version.sh +Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4ac8b9c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM nixos/nix:latest +WORKDIR /app +COPY . . + +RUN nix \ + --extra-experimental-features "nix-command flakes" \ + build .#app + +CMD [ "/app/result/bin/app" ] + diff --git a/flake.nix b/flake.nix index 3b18a7f..896db7d 100644 --- a/flake.nix +++ b/flake.nix @@ -18,6 +18,8 @@ pkgs = import nixpkgs { inherit system; }; + package = pkgs.callPackage ./default.nix { }; + app = pkgs.writeShellScriptBin "app" "${pkgs.merecat}/bin/merecat -n -p 8080 ${package}/share/web"; in { formatter = pkgs.nixpkgs-fmt; @@ -26,7 +28,10 @@ pkgs.zs ]; }; - packages.default = pkgs.callPackage ./default.nix { }; + packages = { + inherit app; + default = package; + }; } ); }