This commit is contained in:
2025-11-06 13:46:19 +01:00
parent e76cb3dc21
commit b7efae61c4
6 changed files with 128 additions and 16 deletions

View File

@@ -12,11 +12,46 @@ The abstraction layer is an asyncio-based worker that manages device communicati
## Running
### Local Development
```bash
# Start the abstraction worker
poetry run python -m apps.abstraction.main
```
### Docker Container
#### Build Image
```bash
docker build -t abstraction:dev -f apps/abstraction/Dockerfile .
```
#### Run Container
```bash
docker run --rm \
-v $(pwd)/config:/app/config:ro \
-e MQTT_BROKER=172.16.2.16 \
-e MQTT_PORT=1883 \
-e REDIS_HOST=172.23.1.116 \
-e REDIS_PORT=6379 \
-e REDIS_DB=8 \
abstraction:dev
```
#### Environment Variables
| Variable | Default | Description |
|----------|---------|-------------|
| `MQTT_BROKER` | `172.16.2.16` | MQTT broker hostname/IP |
| `MQTT_PORT` | `1883` | MQTT broker port |
| `REDIS_HOST` | `localhost` | Redis server hostname/IP |
| `REDIS_PORT` | `6379` | Redis server port |
| `REDIS_DB` | `0` | Redis database number |
### What the Worker Does
The worker will:
1. Load configuration from `config/devices.yaml`
2. Connect to MQTT broker (172.16.2.16:1883)