Skip to content

Commit

Permalink
fix Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbecich committed Jan 7, 2024
1 parent a557b8c commit 5c1783c
Showing 1 changed file with 25 additions and 13 deletions.
38 changes: 25 additions & 13 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -209,34 +209,46 @@
];
};

packages.bar = ps.output {
};
# single file
# packages.foo = ps.bundle {
# # incremental = true;
# esbuild = {
# outfile = "/usr/bin/main.js";
# format = "iife";
# };
# main = true;
# };

packages.foo = ps.bundle {
# incremental = true;
# https://github.com/purs-nix/purs-nix/blob/master/docs/derivations.md#app
packages.foo = ps.app {
name = "main.js";
esbuild = {
outfile = "main.js";
format = "iife";
};
main = true;
};
# packages.purescriptOutput = ps.output {};
# packages.purescriptBundle = ps.bundle {
# module = "Main";
# };

packages.bar = pkgs.stdenv.mkDerivation rec {
name = "javascript bundle";
src = self'.packages.foo;
dontUnpack = true;
installPhase = ''
mkdir -p $out/app/static
cp $src/bin/main.js $out/app/static/main.js
'';
};

packages.dockerImage = pkgs.dockerTools.buildImage {
name = "peterbecich/halogen-chess";
tag = "latest";
created = "now";
copyToRoot = pkgs.buildEnv {
name = "image-root";
# pathsToLink = [ "/app/static" "/usr/bin" ];
# pathsToLink = [ "/usr/bin" ];
paths = [
self'.packages.halogen-chess
# TODO
# staticFiles
# self'.packages.foo
# (ps.bundle {})
# self'.packages.bar
];
# paths
};
Expand Down

0 comments on commit 5c1783c

Please sign in to comment.