Browse Source

using swap-feature from fly.io

Rodja Trappe 1 year ago
parent
commit
97d4027325
2 changed files with 2 additions and 9 deletions
  1. 0 6
      fly-entrypoint.sh
  2. 2 3
      fly.toml

+ 0 - 6
fly-entrypoint.sh

@@ -1,12 +1,6 @@
 #!/bin/bash
 set -e
 
-if [[ ! -z "$SWAP" ]]; then
-  fallocate -l $(($(stat -f -c "(%a*%s/10)*7" .))) _swapfile
-  mkswap _swapfile
-  swapon _swapfile
-fi
-
 free -hm
 df -h
 exec "$@"

+ 2 - 3
fly.toml

@@ -7,6 +7,8 @@ app = "nicegui"
 primary_region = "fra"
 kill_signal = "SIGTERM"
 kill_timeout = "5s"
+swap_size_mb = 2048
+
 
 [build]
   dockerfile = "fly.dockerfile"
@@ -17,9 +19,6 @@ kill_timeout = "5s"
 [processes]
   app = ""
 
-[env]
-  SWAP = "true"
-
 [[services]]
   protocol = "tcp"
   internal_port = 8080