From 61a931deadb9b4cd83966f8a452dd9c90a688e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Sun, 7 May 2023 01:16:26 +0200 Subject: [PATCH] fix: add swapfile --- start.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/start.sh b/start.sh index d81332a4..4488fd10 100755 --- a/start.sh +++ b/start.sh @@ -1,10 +1,17 @@ -#!/bin/sh +#!/bin/sh -ex # This file is how Fly starts the server (configured in fly.toml). Before starting # the server though, we need to run any prisma migrations that haven't yet been # run, which is why this file exists in the first place. # Learn more: https://community.fly.io/t/sqlite-not-getting-setup-properly/4386 -set -ex +# allocate swap space +fallocate -l 512M /swapfile +chmod 0600 /swapfile +mkswap /swapfile +echo 10 > /proc/sys/vm/swappiness +swapon /swapfile +echo 1 > /proc/sys/vm/overcommit_memory + npx prisma migrate deploy npm run start