Sign inSign up

germanorizzo/sqliterg

By germanorizzo

Updated almost 3 years ago

A SQLite remote gateway - query SQLite via HTTP (https://github.com/proofrock/sqliterg/)

Image
0

1.2K

germanorizzo/sqliterg repository overview

🌿 sqliterg

sqliterg is a server-side application that, applied to one or more SQLite files, gives the possibility to perform SQL queries and statements on them via REST (or better, JSON over HTTP).

Full docs are available here, while the github repository is here.

Possible use cases are the ones where remote access to a SQLite db is useful/needed, for example a data layer for a remote application, possibly serverless or even called directly from a web page (after security considerations of course).

Docker image

The image is based on alpine:latest. It's a multiarch image for amd64 and ARM64/v8.

Here are the relevant configurations:

Exposed port12321Fixed; remap it with -p
Config dir/dataFixed; remap it with -v
User to run as--user <user_id>[:<group_id>]Docker standard switch; do use it
Timezone-e TZ=xxx/yyyDocker standard env var
Example
docker run -d \
 --restart=unless-stopped \
 --name=sqliterg \
 -p 8080:12321 \
 -v /mnt/DockerHome/myDir:/data \
 --user 1000:1001 \
 -e TZ=Europe/Rome \
 germanorizzo/sqliterg:latest \
 --db /data/testDb.db

This command will install and run sqliterg, configuring it to:

  • Use port 8080 (Line 4);
  • Map a local dir to path /data in the docker environment (Line 5);
  • Starts sqliterg as user 1000, group 1001 (Line 6);
  • Sets the time zone (Line 7);
  • Use free cli arguments, as it was the sqliterg binary (Line 9).

The rest of the lines in this example are standard Docker.

Important
  • It's important to use --user, otherwise sqliterg will start with root privileges! You don't want this, as it creates files; for example, backups may potentially overwrite some file or wreak havoc in unpredictable ways (which are actually very predictable, but only after they happen).
Caveats
  • You have to reference database and companion files that are in the directory mapped to /data as they were in /data;
  • The path for the database file should be absolute, i.e. /data/....

Tag summary

Content type

Image

Digest

sha256:9a0ac781f

Size

6 MB

Last updated

almost 3 years ago

docker pull germanorizzo/sqliterg