Docker Compose
Docker Compose is the recommended way to run SuiviBourse. It deploys the full stack:
suivi-bourse-app— the applicationsuivi-bourse-influxdb— a pre-initialized InfluxDB 3 Core instancesuivi-bourse-graf— a Grafana with a provisioned datasource and dashboard
Requirements
- Windows, Linux or macOS
- Docker (> 19.03)
- Docker Compose
Steps
-
Download the source code from the latest release and extract it.
-
Move into the
docker-composefolder. -
Configure your portfolio using one of the two modes:
- Manual mode
- Events mode
Edit config.yaml following the manual mode doc:
shares:
- name: Apple
symbol: AAPL
purchase:
quantity: 1
fee: 2
cost_price: 119.98
estate:
quantity: 2
received_dividend: 2.85
- Create a
settings.yamlfile:
mode: events
events:
source: /home/appuser/.config/SuiviBourse/events/
watch: true
- Add your transaction files to the
events/directory:
date,event_type,symbol,name,quantity,unit_price,fee,amount,notes
2024-01-15,BUY,AAPL,Apple Inc,10,150.00,2.50,,Initial purchase
2024-03-01,DIVIDEND,AAPL,Apple Inc,,,,8.50,Q1 2024
- Select events mode in the
.envfile:
SB_CONFIG_MODE=events
See the events mode doc for the full CSV format and backfill for historical data.
- Start the stack:
docker compose up -d
Ports
| Service | Port | Purpose |
|---|---|---|
| Grafana | 3000 | Dashboards (login admin / admin) |
| InfluxDB 3 | 8181 | Database HTTP API |
| App | 8081 | Legacy Prometheus /metrics endpoint |
Environment variables
Edit the .env file in the docker-compose folder:
SCRAPING_INTERVAL=120
# InfluxDB 3 Configuration
INFLUXDB_DATABASE=suivi_bourse
INFLUXDB_TOKEN=apiv3_suivi-bourse-admin-token-for-local-development
| Variable | Default | Description |
|---|---|---|
SCRAPING_INTERVAL | 120 | Price scraping interval (seconds) |
INGESTION_INTERVAL | 300 | Event ingestion interval (seconds) |
BACKFILL_INTERVAL | 60 | Backfill check interval (seconds) |
BACKFILL_DELAY | 10 | Delay between backfill requests (seconds) |
BACKFILL_CHUNK_DAYS | 365 | Days of history per backfill request |
SB_CONFIG_MODE | manual | Configuration mode (manual or events) |
INFLUXDB_DATABASE | suivi_bourse | InfluxDB database name |
INFLUXDB_TOKEN | (preset) | InfluxDB admin token (matches the provisioned token) |
GF_ADMIN_PASSWORD | admin | Grafana admin password |
The compose stack ships with a development admin token
(apiv3_suivi-bourse-admin-token-for-local-development), preconfigured in both
InfluxDB and the Grafana datasource. Change it before any non-local use by
editing influxdb3-token.json, the Grafana datasource under
grafana_provisioning/datasources/, and INFLUXDB_TOKEN in .env.
File structure
After setup, your docker-compose folder looks like:
- Manual mode
- Events mode
docker-compose/
├── .env
├── config.yaml # Your portfolio configuration
├── docker-compose.yaml
├── influxdb3-init.sh # InfluxDB 3 bootstrap (creates the database)
├── influxdb3-token.json # InfluxDB admin token (dev default)
└── grafana_provisioning/
├── datasources/ # InfluxDB SQL datasource
└── dashboards/ # "Stock share monitoring" dashboard
docker-compose/
├── .env # Contains SB_CONFIG_MODE=events
├── settings.yaml # Mode configuration
├── events/ # Your transaction files
│ ├── 2023.csv
│ └── 2024.csv
├── docker-compose.yaml
├── influxdb3-init.sh
├── influxdb3-token.json
└── grafana_provisioning/
├── datasources/
└── dashboards/
Development stack
A docker-compose.dev.yaml is also provided. It builds the app image locally,
runs InfluxDB without authentication, enables DEBUG logging, and also
serves this documentation site. It defaults to events mode:
docker compose -f docker-compose.dev.yaml up -d