Image Name: petdog/battlescope-api:latest
Source: Dockerfile with build args SERVICE_SCOPE=@battlescope/api and BUILD_TARGET=backend/api
REST API gateway providing access to battle data, killmail information, search functionality, and administrative operations. Built with Fastify for high performance.
| Variable | Description | Default | Required |
|---|---|---|---|
PORT | HTTP port to listen on | 3000 | No |
HOST | Host to bind to | 0.0.0.0 | No |
DEVELOPER_MODE | Enable developer mode (verbose logging) | false | No |
CORS_ALLOWED_ORIGINS | Comma-separated list of allowed CORS origins | [] | No |
LOG_LEVEL | Logging level (trace, debug, info, warn, error) | info | No |
| Variable | Description | Default | Required |
|---|---|---|---|
DATABASE_URL | PostgreSQL connection string | - | Yes |
POSTGRES_HOST | PostgreSQL host | localhost | If no DATABASE_URL |
POSTGRES_PORT | PostgreSQL port | 5432 | No |
POSTGRES_DB | Database name | battlescope | No |
POSTGRES_USER | Database user | - | If no DATABASE_URL |
POSTGRES_PASSWORD | Database password | - | If no DATABASE_URL |
POSTGRES_SSL | Enable SSL connection | false | No |
| Variable | Description | Default | Required |
|---|---|---|---|
ESI_REDIS_CACHE_URL | Redis URL for ESI API caching | - | No |
SESSION_REDIS_URL | Redis URL for session storage | - | Yes (for auth) |
| Variable | Description | Default | Required |
|---|---|---|---|
ESI_BASE_URL | ESI API base URL | https://esi.evetech.net/latest/ | No |
ESI_DATASOURCE | ESI datasource | tranquility | No |
ESI_COMPATIBILITY_DATE | ESI compatibility date | 2025-09-30 | No |
ESI_TIMEOUT_MS | ESI request timeout (ms) | 10000 | No |
ESI_CACHE_TTL_SECONDS | ESI cache TTL | 300 | No |
| Variable | Description | Default | Required |
|---|---|---|---|
EVE_CLIENT_ID | EVE OAuth2 client ID | - | Yes (for auth) |
EVE_CLIENT_SECRET | EVE OAuth2 client secret | - | Yes (for auth) |
EVE_CALLBACK_URL | OAuth2 callback URL | - | Yes (for auth) |
EVE_SCOPES | Space-separated OAuth2 scopes | publicData | No |
ENCRYPTION_KEY | 32-byte encryption key (base64) for token storage | - | Yes (for auth) |
SESSION_TTL_SECONDS | Session lifetime | 28800 (8 hours) | No |
SESSION_COOKIE_NAME | Session cookie name | battlescope_session | No |
SESSION_COOKIE_SECURE | Require HTTPS for cookies | true | No |
AUTHZ_CACHE_TTL_SECONDS | Authorization cache TTL | 60 | No |
FRONTEND_URL | Frontend URL for redirects | http://localhost:5173 | Yes (for auth) |
| Variable | Description | Default | Required |
|---|---|---|---|
TYPESENSE_HOST | Typesense server host | typesense.battlescope.svc.cluster.local | Yes |
TYPESENSE_PORT | Typesense server port | 8108 | No |
TYPESENSE_PROTOCOL | Typesense protocol (http/https) | http | No |
TYPESENSE_API_KEY | Typesense API key | battlescope-search-key | Yes |
| Variable | Description | Default | Required |
|---|---|---|---|
OTEL_EXPORTER_OTLP_ENDPOINT | OpenTelemetry collector endpoint | http://otel-collector:4318 | No |
OTEL_SERVICE_NAME | Service name for telemetry | battlescope-api | No |
OTEL_METRIC_EXPORT_INTERVAL | Metrics export interval (ms) | 15000 | No |
| Port | Protocol | Description |
|---|---|---|
| 3000 | HTTP | REST API and Swagger UI |
# HTTP health check endpoint
curl http://localhost:3000/healthz
Returns 200 OK with { "status": "ok" } when healthy.
GET /healthz - Health checkGET /docs - Swagger UI documentationGET /openapi.json - OpenAPI specificationGET /battles - List battles with filteringGET /battles/:id - Get battle detailsGET /battles/:id/killmails - Get battle killmailsGET /killmails/recent - Get recent killmailsGET /killmails/stream - SSE stream of new killmailsPOST /search/battles - Search battlesGET /search/entities - Search entities (characters, corps, alliances)GET /admin/rulesets - List ingestion rulesetsPOST /admin/rulesets - Create rulesetPUT /admin/rulesets/:id - Update rulesetDELETE /admin/rulesets/:id - Delete rulesetGET /admin/stats - System statisticsGET /auth/login - Initiate EVE SSO loginGET /auth/callback - OAuth2 callbackPOST /auth/logout - LogoutGET /auth/me - Get current userdocker run -d \
--name battlescope-api \
-p 3000:3000 \
-e DATABASE_URL=postgres://user:pass@postgres:5432/battlescope \
-e REDIS_URL=redis://redis:6379/0 \
-e SESSION_REDIS_URL=redis://redis:6379/2 \
-e EVE_CLIENT_ID=your-client-id \
-e EVE_CLIENT_SECRET=your-secret \
-e EVE_CALLBACK_URL=http://localhost:3000/auth/callback \
-e ENCRYPTION_KEY=$(openssl rand -base64 32) \
-e FRONTEND_URL=http://localhost:5173 \
-e TYPESENSE_HOST=typesense \
-e TYPESENSE_API_KEY=your-api-key \
petdog/battlescope-api:latest
services:
api:
image: petdog/battlescope-api:latest
ports:
- "3000:3000"
environment:
PORT: 3000
HOST: 0.0.0.0
DATABASE_URL: postgres://battlescope:password@postgres:5432/battlescope
REDIS_URL: redis://redis:6379/0
SESSION_REDIS_URL: redis://redis:6379/2
ESI_REDIS_CACHE_URL: redis://redis:6379/1
EVE_CLIENT_ID: ${EVE_CLIENT_ID}
EVE_CLIENT_SECRET: ${EVE_CLIENT_SECRET}
EVE_CALLBACK_URL: http://localhost:3000/auth/callback
ENCRYPTION_KEY: ${ENCRYPTION_KEY}
FRONTEND_URL: http://localhost:5173
TYPESENSE_HOST: typesense
TYPESENSE_PORT: 8108
TYPESENSE_API_KEY: ${TYPESENSE_API_KEY}
SESSION_COOKIE_SECURE: false
depends_on:
- postgres
- redis
- typesense
restart: unless-stopped
See infra/k8s/api-deployment.yaml for the complete Kubernetes manifest.
docker build \
--build-arg SERVICE_SCOPE=@battlescope/api \
--build-arg BUILD_TARGET=backend/api \
-t petdog/battlescope-api:latest \
-f Dockerfile \
.
ENCRYPTION_KEY is 32+ charactersEVE_CALLBACK_URL matches your EVE application configurationDATABASE_URL format: postgres://user:pass@host:port/dbnameTYPESENSE_API_KEY matches Typesense configurationENCRYPTION_KEY (32+ random bytes, base64 encoded)SESSION_COOKIE_SECURE=true in production with HTTPSCORS_ALLOWED_ORIGINS to restrict API accessEVE_CLIENT_SECRET and ENCRYPTION_KEY periodicallyContent type
Image
Digest
sha256:e2091a979…
Size
100.1 MB
Last updated
10 months ago
docker pull petdog/battlescope-api