Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ A [wiki](https://en.wikipedia.org/wiki/Wiki) is a publication collaboratively ed
- [Money-Balancer](examples/money-balancer) - A simple application for managing debt with your friends!
- [Firefly III](examples/firefly) - A self-hosted manager for your personal finances.
- [VoucherVault](examples/vouchervault) - Django web application to store and manage vouchers, coupons, loyalty and gift cards digitally. Supports expiry notifications, transaction histories and file uploads.
- [QuantRank500](examples/quantrank500) - Self-hosted public record of stock predictions, locked before the market opens and settled automatically against exchange data, kept in an append-only hash-chained ledger.

### Genealogy

Expand Down
22 changes: 22 additions & 0 deletions examples/quantrank500/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# References

- https://github.com/RusUsf/quantrank500
- https://quantrank500.com
- https://github.com/RusUsf/quantrank500/tree/master/examples

# Notes

No image is published to a registry yet, so `api` and `worker` build straight
from the git context. The first `docker compose up` therefore compiles the
image; later starts reuse it.

Both services run the same image and differ only in the command: `api` serves
the public HTTP API on port 8000, `worker` runs the nightly settlement replay.

Change `CHANGEME` in all four places (the Postgres password and the two DSNs)
before starting.

The upstream repository also ships an nginx service that serves the static
frontend and rate-limits the API. It is left out here because it bind-mounts
files from a checkout; clone the repository and use its own
`docker-compose.yml` if you want the web UI as well.
67 changes: 67 additions & 0 deletions examples/quantrank500/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
services:

quantrank500-db:
image: postgres:16
container_name: quantrank500-db
hostname: quantrank500-db
restart: unless-stopped
expose:
- 5432
volumes:
- ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/quantrank500/postgres:/var/lib/postgresql/data
environment:
- POSTGRES_USER=quantrank
- POSTGRES_PASSWORD=CHANGEME
- POSTGRES_DB=quantrank500
- TZ=Europe/Berlin
networks:
- quantrank500

quantrank500-api:
build: https://github.com/RusUsf/quantrank500.git
container_name: quantrank500-api
hostname: quantrank500-api
restart: unless-stopped
depends_on:
- quantrank500-db
ports:
- 8000:8000/tcp
expose:
- 8000
environment:
- QR500_ENV=dev
- QR500_API_HOST=0.0.0.0
- QR500_PG_DSN=postgresql://quantrank:CHANGEME@quantrank500-db:5432/quantrank500
- QR500_LAKE_DSN=postgresql://quantrank:CHANGEME@quantrank500-db:5432/quantrank500
- TZ=Europe/Berlin
networks:
- quantrank500
# - proxy
#labels:
# - traefik.enable=true
# - traefik.docker.network=proxy
# - traefik.http.routers.quantrank500.rule=Host(`quantrank500.example.com`)
# - traefik.http.routers.quantrank500.entrypoints=https
# - traefik.http.routers.quantrank500.tls=true
# - traefik.http.services.quantrank500.loadbalancer.server.port=8000

quantrank500-worker:
build: https://github.com/RusUsf/quantrank500.git
container_name: quantrank500-worker
hostname: quantrank500-worker
restart: unless-stopped
command: ["python", "scripts/run_worker.py"]
depends_on:
- quantrank500-db
environment:
- QR500_ENV=dev
- QR500_PG_DSN=postgresql://quantrank:CHANGEME@quantrank500-db:5432/quantrank500
- QR500_LAKE_DSN=postgresql://quantrank:CHANGEME@quantrank500-db:5432/quantrank500
- TZ=Europe/Berlin
networks:
- quantrank500

networks:
quantrank500:
#proxy:
# external: true