-
Notifications
You must be signed in to change notification settings - Fork 380
/
litefs.yml
43 lines (35 loc) · 1.36 KB
/
litefs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Documented example: https://github.com/superfly/litefs/blob/dec5a7353292068b830001bd2df4830e646f6a2f/cmd/litefs/etc/litefs.yml
fuse:
# Required. This is the mount directory that applications will
# use to access their SQLite databases.
dir: '${LITEFS_DIR}'
data:
# Path to internal data storage.
dir: '/data/litefs'
proxy:
# matches the internal_port in fly.toml
addr: ':${INTERNAL_PORT}'
target: 'localhost:${PORT}'
db: '${DATABASE_FILENAME}'
# The lease section specifies how the cluster will be managed. We're using the
# "consul" lease type so that our application can dynamically change the primary.
#
# These environment variables will be available in your Fly.io application.
lease:
type: 'consul'
candidate: ${FLY_REGION == PRIMARY_REGION}
promote: true
advertise-url: 'http://${HOSTNAME}.vm.${FLY_APP_NAME}.internal:20202'
consul:
url: '${FLY_CONSUL_URL}'
key: 'epic-stack-litefs/${FLY_APP_NAME}'
exec:
- cmd: npx prisma migrate deploy
if-candidate: true
# 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
# 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