A self-hosted GPS track manager REST API built with FastAPI and PostgreSQL/PostGIS.
1.0K
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.
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.
Copy .env_example to .env and adjust the values before running locally without Docker.
| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_URI | yes | — | Async PostgreSQL connection string (postgresql+asyncpg://…) |
TOKEN_URL | yes | — | Full URL of the login endpoint, e.g. http://localhost:8000/auth/login |
SECRET_KEY | yes | — | Random secret used to sign JWTs. Generate with openssl rand -hex 32 |
IMAGE_PATH | yes | — | Directory where uploaded images are stored |
ALGORITHM | no | HS256 | JWT signing algorithm |
ACCESS_TOKEN_EXPIRE_MINUTES | no | 60 | Token validity in minutes |
LOG_LEVEL | no | INFO | DEBUG, INFO, WARNING, ERROR |
SQL_ECHO | no | False | Log all SQL statements (useful for debugging) |
CORS_ORIGINS | no | [] | JSON array of allowed CORS origins, e.g. ["https://app.example.com"] |
REGISTRATION_ENABLED | no | true | Set to false to disable public registration |
EMAIL_CONFIRMATION | no | false | Require e-mail verification before login |
MAX_IMAGE_SIZE | no | 2097152 | Maximum upload size in bytes (default 2 MB) |
CACHE_ENABLED | no | true | Enable response caching |
CACHE_TYPE | no | local | local (in-memory TTLCache) or redis |
CACHE_TTL | no | 3600 | Cache time-to-live in seconds |
CACHE_MAXSIZE | no | 1000 | Maximum entries for the local cache |
REDIS_HOST | no | 127.0.0.1 | Redis hostname (only when CACHE_TYPE=redis) |
REDIS_PORT | no | 6379 | Redis port |
REDIS_DB | no | 0 | Redis database index |
REDIS_PASSWORD | no | — | Redis password |
REDIS_USERNAME | no | — | Redis username |
Content type
Image
Digest
sha256:4710cd272…
Size
172.8 MB
Last updated
5 months ago
docker pull gpappsoft/ort