simplify docker build
Alan Pearce alan@alanpearce.eu
Sun, 23 Jun 2024 20:05:50 +0200
2 files changed, 5 insertions(+), 10 deletions(-)
jump to
M default.nix → default.nix
@@ -15,9 +15,6 @@ runCommandLocal; version = "unstable"; mkDocker = type: { server, website }: - let - PORT = 80; - in pkgs.dockerTools.${type} { name = "registry.fly.io/alanpearce-eu"; config = { @@ -25,11 +22,12 @@ Cmd = [ "${server}/bin/server" ]; Env = [ "PRODUCTION=true" "LISTEN_ADDRESS=::" - "PORT=${builtins.toString PORT}" - "ROOT=${website}" + "ROOT=." + "PORT=80" ]; + WorkingDir = website; ExposedPorts = { - "${builtins.toString PORT}/tcp" = { }; + "80/tcp" = { }; }; }; }; @@ -90,6 +88,7 @@ ]; }; } '' ${builder}/bin/build -s $src -d $out + cp $src/config.toml $out/ ''; server = buildGoApplication { pname = "server";