Containerize for Pi: env-var config, compose stack, CI workflow
Some checks failed
build-and-deploy / build (push) Failing after 18s
Some checks failed
build-and-deploy / build (push) Failing after 18s
- Add app/config.py (12-factor, env-driven: DB/NATS/MinIO, URL-encoded pw) - Route database/ingestor/sources/alembic through config; kill hardcoded svc.cluster.local hostnames - Drop unused redis dependency - Add docker-compose.yml (timescaledb-postgis pg13 arm64 + optional nats) - Add .env.example, .dockerignore, .forgejo/workflows/build.yml (arm64 build+SSH deploy)
This commit is contained in:
parent
93b8b89639
commit
3d53ed2c1c
11 changed files with 175 additions and 17 deletions
70
docker-compose.yml
Normal file
70
docker-compose.yml
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
# OSINT Dashboard — container stack (all env-driven, 12-factor).
|
||||
# Single combined TimescaleDB+PostGIS image is pinned to pg13 because that is
|
||||
# the only arm64 build Timescale publishes with PostGIS bundled. The app uses
|
||||
# only standard SQL types, so pg13 is fully sufficient.
|
||||
#
|
||||
# Bring up: docker compose up -d
|
||||
# With NATS: docker compose --profile ingest up -d
|
||||
# Env: copy .env.example to .env and adjust.
|
||||
|
||||
services:
|
||||
db:
|
||||
image: timescale/timescaledb-postgis:latest-pg13
|
||||
container_name: osint-db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: ${DB_USER:-osint}
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD:-osint}
|
||||
POSTGRES_DB: ${DB_NAME:-osint_data}
|
||||
ports:
|
||||
- "127.0.0.1:5432:5432"
|
||||
volumes:
|
||||
- osint-pgdata:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-osint} -d ${DB_NAME:-osint_data}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
|
||||
nats:
|
||||
image: nats:2.10
|
||||
container_name: osint-nats
|
||||
restart: unless-stopped
|
||||
profiles: ["ingest"]
|
||||
ports:
|
||||
- "127.0.0.1:4222:4222"
|
||||
- "127.0.0.1:8222:8222"
|
||||
command: ["-js"]
|
||||
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
platforms: ["linux/arm64"]
|
||||
image: localhost/osint-dashboard:latest
|
||||
container_name: osint-dashboard
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
DB_USER: ${DB_USER:-osint}
|
||||
DB_PASSWORD: ${DB_PASSWORD:-osint}
|
||||
DB_HOST: db
|
||||
DB_PORT: ${DB_PORT:-5432}
|
||||
DB_NAME: ${DB_NAME:-osint_data}
|
||||
NATS_URL: ${NATS_URL:-nats://nats:4222}
|
||||
MINIO_ENDPOINT: ${MINIO_ENDPOINT:-minio:9000}
|
||||
MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY:-}
|
||||
MINIO_SECRET_KEY: ${MINIO_SECRET_KEY:-}
|
||||
MINIO_SECURE: ${MINIO_SECURE:-false}
|
||||
ports:
|
||||
- "127.0.0.1:8000:8000"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "python -c \"import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8000/api/health').status==200 else 1)\""]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
volumes:
|
||||
osint-pgdata:
|
||||
Loading…
Reference in a new issue