API docs et Dockerfile for dev

This commit is contained in:
Laurent Chedanne
2026-05-20 11:09:57 +02:00
parent 01fd72d31e
commit afcbb87063
4 changed files with 232 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
Image Docker de développement pour exécuter les scripts Python du projet
This image provides a lightweight Python 3.9.2 environment with the project `requirements.txt` installed.
Build
-----
From the repository root (where `requirements.txt` sits) run:
```bash
docker build -t cal-to-time-manager:dev -f support/docker-dev/Dockerfile .
```
Usage
-----
Run a script from the project root by mounting the repo into `/app`:
```bash
# run csv-to-timemanager.py
docker run --rm -v "$(pwd)":/app -w /app cal-to-time-manager:dev csv-to-timemanager.py
# run with arguments
docker run --rm -v "$(pwd)":/app -w /app cal-to-time-manager:dev csv-to-timemanager.py arg1 arg2
```
Open an interactive shell (override the image entrypoint):
```bash
docker run --rm -it --entrypoint bash -v "$(pwd)":/app -w /app cal-to-time-manager:dev
```
Notes
-----
- The container uses Python 3.9.2 (slim). If your `requirements.txt` needs system packages, adapt the `Dockerfile` to install them.
- The scripts expect `config.json` and CSV files to be present in the mounted workspace path.
- If your scripts connect to services (MySQL, Nextcloud API), ensure the container can reach those hosts (network, VPN, or expose host ports).
- To pass secret credentials, prefer using environment variables or Docker secrets rather than baking them in `config.json` inside the image.