Sign inSign up

gpappsoft/ort

By gpappsoft

Updated 5 months ago

A self-hosted GPS track manager REST API built with FastAPI and PostgreSQL/PostGIS.

Image
API management
Internet of things
0

1.0K

gpappsoft/ort repository overview

Docker

Build the image
docker build -t ort .

The Dockerfile uses a multi-stage Chainguard Wolfi base image and runs the application as a non-root user on port 5000.

Run the container

Minimum required environment variables are DATABASE_URI, TOKEN_URL, SECRET_KEY, and IMAGE_PATH.

docker run --name ort \
  -e DATABASE_URI="postgresql+asyncpg://ort:ort@db-host:5432/ort" \
  -e TOKEN_URL="http://localhost:8000/auth/login" \
  -e SECRET_KEY="$(openssl rand -hex 32)" \
  -e IMAGE_PATH="/tmp" \
  -p 8000:5000 \
  ort:latest

The API is then reachable at http://localhost:8000.

Environment variables

Copy .env_example to .env and adjust the values before running locally without Docker.

VariableRequiredDefaultDescription
DATABASE_URIyesAsync PostgreSQL connection string (postgresql+asyncpg://…)
TOKEN_URLyesFull URL of the login endpoint, e.g. http://localhost:8000/auth/login
SECRET_KEYyesRandom secret used to sign JWTs. Generate with openssl rand -hex 32
IMAGE_PATHyesDirectory where uploaded images are stored
ALGORITHMnoHS256JWT signing algorithm
ACCESS_TOKEN_EXPIRE_MINUTESno60Token validity in minutes
LOG_LEVELnoINFODEBUG, INFO, WARNING, ERROR
SQL_ECHOnoFalseLog all SQL statements (useful for debugging)
CORS_ORIGINSno[]JSON array of allowed CORS origins, e.g. ["https://app.example.com"]
REGISTRATION_ENABLEDnotrueSet to false to disable public registration
EMAIL_CONFIRMATIONnofalseRequire e-mail verification before login
MAX_IMAGE_SIZEno2097152Maximum upload size in bytes (default 2 MB)
CACHE_ENABLEDnotrueEnable response caching
CACHE_TYPEnolocallocal (in-memory TTLCache) or redis
CACHE_TTLno3600Cache time-to-live in seconds
CACHE_MAXSIZEno1000Maximum entries for the local cache
REDIS_HOSTno127.0.0.1Redis hostname (only when CACHE_TYPE=redis)
REDIS_PORTno6379Redis port
REDIS_DBno0Redis database index
REDIS_PASSWORDnoRedis password
REDIS_USERNAMEnoRedis username
Run the container

Github: https://github.com/gpappsoft/ORT.git

Tag summary

Content type

Image

Digest

sha256:4710cd272

Size

172.8 MB

Last updated

5 months ago

docker pull gpappsoft/ort