From 24923a2d99c066031354e11d9a6d5f7363a03f6b Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 23 Jun 2024 20:05:50 +0200 Subject: simplify docker build --- default.nix | 11 +++++------ fly.toml | 4 ---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/default.nix b/default.nix index 4c29731..31f6b91 100644 --- a/default.nix +++ b/default.nix @@ -15,9 +15,6 @@ let version = "unstable"; mkDocker = type: { server, website }: - let - PORT = 80; - in pkgs.dockerTools.${type} { name = "registry.fly.io/alanpearce-eu"; config = { @@ -25,11 +22,12 @@ let 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 @@ rec { }; } '' ${builder}/bin/build -s $src -d $out + cp $src/config.toml $out/ ''; server = buildGoApplication { pname = "server"; diff --git a/fly.toml b/fly.toml index 4488c03..3487e95 100644 --- a/fly.toml +++ b/fly.toml @@ -14,10 +14,6 @@ primary_region = "ams" PORT = "80" REDIRECT_OTHER_HOSTNAMES = "true" -[[files]] - guest_path = "/config.toml" - local_path = "config.toml" - [http_service] internal_port = 80 force_https = true -- cgit 1.4.1