Skip to content

Commit

Permalink
fix: add swapfile (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey authored Nov 7, 2023
1 parent 83ccdee commit 1b32121
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions start.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1b32121

Please sign in to comment.