1
0
Fork 0

Add simple Docker build for project

This commit is contained in:
Vili Sinervä 2025-01-16 04:06:59 +02:00
parent 8f8565e07d
commit 7093aa4c9c
No known key found for this signature in database
GPG key ID: DF8FEAF54EFAC996
2 changed files with 24 additions and 0 deletions

23
docker.nix Normal file
View file

@ -0,0 +1,23 @@
let
pkgs = import <nixpkgs> { };
compiler-project = import ./default.nix { rustPlatform = pkgs.rustPlatform; };
source-code = builtins.fetchGit {
url = "https://gitea.vsinerva.fi/VSinerva/compiler-course.git";
name = "compiler-course-src";
ref = "main";
};
in
pkgs.dockerTools.buildImage {
name = "compiler-course-docker";
copyToRoot = pkgs.buildEnv {
name = "project-source";
paths = [ source-code ];
extraPrefix = "/Project_Source";
};
config = {
ExposedPorts = {
"3000/tcp" = { };
};
Cmd = [ "${compiler-project}/bin/compiler-course" ];
};
}

View file

@ -15,6 +15,7 @@ pkgs.mkShell {
rustc rustc
rustfmt rustfmt
clippy clippy
docker
]) ])
++ [ build-command ]; ++ [ build-command ];
} }