about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2024-06-23 20:05:50 +0200
committerAlan Pearce2024-06-23 20:05:50 +0200
commit24923a2d99c066031354e11d9a6d5f7363a03f6b (patch)
treee1c7a3f4ea56a6e730acfbca739389a7fad4873e
parentca4e1a14212033d81caf4a58107a4bdc2912c4b7 (diff)
downloadwebsite-24923a2d99c066031354e11d9a6d5f7363a03f6b.tar.lz
website-24923a2d99c066031354e11d9a6d5f7363a03f6b.tar.zst
website-24923a2d99c066031354e11d9a6d5f7363a03f6b.zip
simplify docker build
-rw-r--r--default.nix11
-rw-r--r--fly.toml4
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