From cd0d2ec37df971ddf46c4311ab2ffd93e4fc75b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Sat, 4 Nov 2023 00:41:25 +0100 Subject: [PATCH] fix: add swapfile --- start.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/start.sh b/start.sh index c914f2b8..4488fd10 100755 --- a/start.sh +++ b/start.sh @@ -1,8 +1,17 @@ -# This file is how Fly starts the server (configured in fly.toml). -# Before starting the server, we need to run any prisma migrations that haven't yet been run. +#!/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 -npx node prisma/seed/prisma/seed.js npm run start