all repos — website @ 24923a2d99c066031354e11d9a6d5f7363a03f6b

My website

simplify docker build
Alan Pearce alan@alanpearce.eu
Sun, 23 Jun 2024 20:05:50 +0200
commit

24923a2d99c066031354e11d9a6d5f7363a03f6b

parent

ca4e1a14212033d81caf4a58107a4bdc2912c4b7

2 files changed, 5 insertions(+), 10 deletions(-)

jump to
M default.nixdefault.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";
M fly.tomlfly.toml
@@ -14,10 +14,6 @@ BASE_URL = "https://alanpearce.eu"   PORT = "80"
   REDIRECT_OTHER_HOSTNAMES = "true"
 
-[[files]]
-  guest_path = "/config.toml"
-  local_path = "config.toml"
-
 [http_service]
   internal_port = 80
   force_https = true