dockerize

This commit is contained in:
Adithya 2024-01-04 18:27:38 +05:30
parent 6401393a10
commit 2a2259f049
Signed by: adtya
GPG key ID: 48FC9915FFD326D0
3 changed files with 27 additions and 5 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,16 +18,21 @@
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
with pkgs; {
formatter = nixpkgs-fmt;
devShells.default = mkShell {
packages = [
{
formatter = pkgs.nixpkgs-fmt;
devShells.default = pkgs.mkShell {
packages = with pkgs; [
mdbook
tailwindcss-language-server
];
};
packages.default = callPackage ./default.nix { };
packages = {
inherit app;
default = package;
};
}
);
}