dockerize

This commit is contained in:
Adithya 2024-01-04 18:10:24 +05:30
parent 31bfa9fbd1
commit 8137dc9bc8
Signed by: adtya
GPG key ID: 48FC9915FFD326D0
3 changed files with 23 additions and 1 deletions

7
.dockerignore Normal file
View file

@ -0,0 +1,7 @@
.direnv/
.git/
.github/
.pub/
result
update-version.sh
Dockerfile

10
Dockerfile Normal file
View file

@ -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" ]

View file

@ -18,6 +18,8 @@
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
}; };
package = pkgs.callPackage ./default.nix { };
app = pkgs.writeShellScriptBin "app" "${pkgs.merecat}/bin/merecat -n -p 8080 ${package}/share/web";
in in
{ {
formatter = pkgs.nixpkgs-fmt; formatter = pkgs.nixpkgs-fmt;
@ -26,7 +28,10 @@
pkgs.zs pkgs.zs
]; ];
}; };
packages.default = pkgs.callPackage ./default.nix { }; packages = {
inherit app;
default = package;
};
} }
); );
} }