1.9 KiB
1.9 KiB
Build and Deployment
Runtime Targets
- Local Python process using Uvicorn.
- Docker container via
Dockerfile. - Docker Compose service via
docker-compose.yml.
Related references:
- Configuration fields:
doc/environment.md - Architecture:
doc/architecture.md
Local Run
Typical local launch command:
uvicorn app.main:app --reload --port 8080
Service endpoint:
http://localhost:8080
Notes:
- The app reads environment variables at startup.
- Database parent directory is created automatically.
Docker Image Build Rules
Build file: Dockerfile
Current build behavior:
- Base image:
python:3.12-slim - Install Python dependencies from
requirements.txt - Copy
app/anddata/into image - Expose container port
8080 - Start with Uvicorn on
0.0.0.0:8080
Docker Compose Rules
Compose file: docker-compose.yml
Dashboard service settings:
- Publishes
8080:8080 - Loads environment from
.env - Sets:
DATA_DIR=/app/dataDB_PATH=/app/data/dashboard.db
- Mounts volume:
./data:/app/data
- Adds host gateway alias:
host.docker.internal:host-gateway
- Restart policy:
unless-stopped
Persistence Rules
- Persist
./dataon the host to retain:- node settings
- chart metric history
- If
data/dashboard.dbis not persisted, settings and history reset when the container is recreated.
Network Rules
If the Bitcoin node runs on the Docker host:
- Prefer RPC URL
http://host.docker.internal:8332.
If using remote node hosts:
- Set RPC URL directly to the node endpoint.
- Ensure SSH host/credentials are valid for start/restart actions.
Deployment Checklist
- Set strong
APP_PASSWORDor provideAPP_PASSWORD_HASH. - Set a long random
SESSION_SECRET. - Set
SESSION_COOKIE_SECURE=truebehind HTTPS. - Persist the database volume.
- Restrict dashboard network exposure to trusted operators.