diff --git a/docker.nix b/docker.nix new file mode 100644 index 0000000..6917513 --- /dev/null +++ b/docker.nix @@ -0,0 +1,23 @@ +let + pkgs = import { }; + 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" ]; + }; +} diff --git a/shell.nix b/shell.nix index 7a32e7a..80f8394 100644 --- a/shell.nix +++ b/shell.nix @@ -15,6 +15,7 @@ pkgs.mkShell { rustc rustfmt clippy + docker ]) ++ [ build-command ]; }