Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
fix(docker): fix docker compose file for litestream
Browse files Browse the repository at this point in the history
  • Loading branch information
dtfiedler committed May 23, 2024
1 parent 223fdde commit 3b02805
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .env.litestream.sample
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ TVAL_LOCAL_DB_PATH=/cache/warp/sqlite
TVAL_AWS_ACCESS_KEY_ID=
TVAL_AWS_SECRET_ACCESS_KEY=
TVAL_S3_BUCKET_PATH=s3://<bucket-name>/<sqlite-path>/
WAIT_TIME_SECONDS=0
WAIT_TIME_SECONDS=
RESTORE_FROM_BACKUP=false
15 changes: 8 additions & 7 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@ services:

litestream:
profiles: ['litestream']
build:
build:
context: litestream
environment:
TVAL_LOCAL_DB_PATH: ${LOCAL_DB_PATH:-/app/data/sqlite}
TVAL_S3_BUCKET_PATH: ${S3_BUCKET_PATH:-}
TVAL_AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID:-}
TVAL_AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY:-}
WAIT_TIME_SECONDS: ${WAIT_TIME_SECONDS:-}
RESTORE_FROM_BACKUP: ${RESTORE_FROM_BACKUP:-false}
TVAL_LOCAL_DB_PATH: ${LITESTREAM_LOCAL_DB_PATH:-/app/data/sqlite}
TVAL_S3_BUCKET_PATH: ${LITESTREAM_S3_BUCKET_PATH:-}
TVAL_S3_BUCKET: ${LITESTREAM_S3_BUCKET:-}
TVAL_AWS_ACCESS_KEY_ID: ${LITESTREAM_AWS_ACCESS_KEY_ID:-}
TVAL_AWS_SECRET_ACCESS_KEY: ${LITESTREAM_AWS_SECRET_ACCESS_KEY:-}
WAIT_TIME_SECONDS: ${LITESTREAM_WAIT_TIME_SECONDS:-}
RESTORE_FROM_BACKUP: ${LITESTREAM_RESTORE_FROM_BACKUP:-false}
volumes:
- ${WARP_SQLITE_CACHE_PATH:-./cache/warp/sqlite}:/app/data/sqlite

Expand Down
3 changes: 2 additions & 1 deletion litestream/.env.sample
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
TVAL_LOCAL_DB_PATH=/cache/warp/sqlite
TVAL_AWS_ACCESS_KEY_ID=
TVAL_AWS_SECRET_ACCESS_KEY=
TVAL_S3_BUCKET_PATH=s3://<bucket-name>/<sqlite-path>/
TVAL_S3_BUCKET_PATH=/<sqlite-path-in-s3/
TVAL_S3_BUCKET=
WAIT_TIME_SECONDS=0
RESTORE_FROM_BACKUP=false
8 changes: 6 additions & 2 deletions litestream/litestream.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ secret-access-key: #@ data.values.AWS_SECRET_ACCESS_KEY
dbs:
- path: #@ data.values.LOCAL_DB_PATH + "/state.db"
replicas:
- url: #@ data.values.S3_BUCKET_PATH
- type: s3
bucket: #@ data.values.S3_BUCKET
path: #@ data.values.S3_BUCKET_PATH
- path: #@ data.values.LOCAL_DB_PATH + "/contract.db"
replicas:
- url: #@ data.values.S3_BUCKET_PATH
- type: s3
bucket: #@ data.values.S3_BUCKET
path: #@ data.values.S3_BUCKET_PATH
5 changes: 1 addition & 4 deletions src/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ import { getContractState } from './api/warp';
import { prefetchContractTxIds } from './config';
import logger from './logger';
import { warp } from './middleware';
import {
PREFETCH_CONTRACTS,
} from './constants';

import { PREFETCH_CONTRACTS } from './constants';

export const bootstrapCache = async () => {
if (PREFETCH_CONTRACTS) {
Expand Down

0 comments on commit 3b02805

Please sign in to comment.