From 1db33337800229a4f8ffcadbd9831e3bfe6fde83 Mon Sep 17 00:00:00 2001 From: Derick Date: Sun, 18 Feb 2024 11:42:27 -0600 Subject: [PATCH] TM --- Dockerfile | 3 ++- fly.toml | 2 +- other/litefs.yml | 14 +++++++------- other/setup-swap.js | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 99a0105..d9cc138 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,8 @@ FROM node:20-bookworm-slim as base ENV NODE_ENV production # Install openssl for Prisma -RUN apt-get update && apt-get install -y fuse3 openssl sqlite3 ca-certificates +RUN apt-get update && apt-get install -y fuse3 openssl ffmpeg sqlite3 ca-certificates procps python3 make g++ + # Install all node_modules, including dev dependencies FROM base as deps diff --git a/fly.toml b/fly.toml index e0ca717..3ba44ed 100644 --- a/fly.toml +++ b/fly.toml @@ -12,7 +12,7 @@ processes = [] [mounts] source = "data" destination = "/data" - +processes = ["app"] [build] diff --git a/other/litefs.yml b/other/litefs.yml index abb1e3c..d8a7d63 100644 --- a/other/litefs.yml +++ b/other/litefs.yml @@ -6,7 +6,7 @@ fuse: data: # Path to internal data storage. - dir: '/var/lib/litefs' + dir: '/data/litefs' proxy: # matches the internal_port in fly.toml @@ -20,7 +20,7 @@ proxy: # These environment variables will be available in your Fly.io application. lease: type: 'consul' - candidate: ${FLY_REGION == PRIMARY_REGION} + candidate: 'ord' promote: true advertise-url: 'http://${HOSTNAME}.vm.${FLY_APP_NAME}.internal:20202' @@ -34,11 +34,11 @@ exec: # re-enable these when this is fixed: https://github.com/superfly/litefs/issues/425 # # Set the journal mode for the database to WAL. This reduces concurrency deadlock issues - # - cmd: sqlite3 $DATABASE_PATH "PRAGMA journal_mode = WAL;" - # if-candidate: true + - cmd: sqlite3 $DATABASE_PATH "PRAGMA journal_mode = WAL;" + if-candidate: true - # # Set the journal mode for the cache to WAL. This reduces concurrency deadlock issues - # - cmd: sqlite3 $CACHE_DATABASE_PATH "PRAGMA journal_mode = WAL;" - # if-candidate: true + # Set the journal mode for the cache to WAL. This reduces concurrency deadlock issues + - cmd: sqlite3 $CACHE_DATABASE_PATH "PRAGMA journal_mode = WAL;" + if-candidate: true - cmd: npm start \ No newline at end of file diff --git a/other/setup-swap.js b/other/setup-swap.js index 6e70ec3..4db7181 100644 --- a/other/setup-swap.js +++ b/other/setup-swap.js @@ -1,7 +1,7 @@ #!/usr/bin/env node -import { writeFile } from 'node:fs/promises' -import { $ } from 'execa' +import {$} from 'execa' +import {writeFile} from 'node:fs/promises' console.log('setting up swapfile...') await $`fallocate -l 512M /swapfile`