Source: https://github.com/nickadam/litestream
Secrets can be set in files and the path to those files specified in environment variables
Config file can be defined as an environment variable
docker-entrypoint.sh can be used to set environment variables and restore through the running "replicate" service
/docker-entrypoint.sh restore /data/db.sqlite3
version: "3.9"
services:
app:
image: alpine
command: sh -c 'apk add sqlite; sleep 3155760000'
volumes:
- type: volume
source: data
target: /data
litestream:
image: nickadam/litestream
build:
context: docker
dockerfile: Dockerfile
command: replicate
environment:
LITESTREAM_ACCESS_KEY_ID: minioadmin
LITESTREAM_SECRET_ACCESS_KEY_FILE: /run/secrets/miniosecret
LITESTREAM_CONFIG_CONTENT: |
dbs:
- path: /data/db.sqlite3
replicas:
- type: s3
bucket: app
path: db
endpoint: http://minio:9000
volumes:
- type: volume
source: data
target: /data
secrets:
- miniosecret
minio:
image: minio/minio
command: server /data
ports:
- target: 9000
published: 9000
protocol: tcp
mode: host
volumes:
- type: volume
source: replica
target: /data
volumes:
data:
replica:
secrets:
miniosecret:
external: true
Content type
Image
Digest
Size
12 MB
Last updated
over 5 years ago
docker pull nickadam/litestream