Skip to content

Latest commit

 

History

History
54 lines (41 loc) · 1.19 KB

README.md

File metadata and controls

54 lines (41 loc) · 1.19 KB

turso-sync

Packages: https://github.com/flexchar/turso-sync/pkgs/container/turso-sync GitHub: https://github.com/flexchar/turso-sync

This is to solve personal problem but could also be made for others. To do so, I'd like to build a dedicated image for each platform.

To install dependencies:

bun install
cp .env.example .env

To test docker locally:

docker build -t turso-sync:local . && docker run --rm -it --env-file .env -v turso-volume:/turso turso-sync:local

using docker compose:

docker compose up --build --force-recreate

To build:

now=$(date +%s)
tag="ghcr.io/flexchar/turso-sync:$now"
echo "building image for tag: $tag"
docker build --platform=linux/amd64 -t $tag -t ghcr.io/flexchar/turso-sync:latest .
docker push $tag

To use in Docker Compose

services:
    #...other services
    turso-sync:
        image: ghcr.io/flexchar/turso-sync:latest
        volumes:
            - turso_data:/turso
        environment:
            - LIBSQL_DB_URL=${LIBSQL_DB_URL}
            - LIBSQL_DB_AUTH_TOKEN=${LIBSQL_DB_AUTH_TOKEN}
            - OUTPUT_DB_PATH=${OUTPUT_DB_PATH}
            - SYNC_INTERVAL=${SYNC_INTERVAL}

volumes:
    turso_data: