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

@@ -19,7 +19,6 @@ WORKDIR /app
# Install system dependencies
RUN apk add --no-cache \
curl \
gcc \
musl-dev \
linux-headers
@@ -38,10 +37,6 @@ RUN chown -R app:app /app
# Switch to non-root user
USER app
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8010/health || exit 1
# Expose port
EXPOSE 8010

View File

@@ -28,22 +28,50 @@ Der Simulator ist bereits Teil des Projekts. Keine zusätzlichen Dependencies er
## Start
### Local Development
```bash
# Standard-Start (Port 8003)
poetry run uvicorn apps.simulator.main:app --host 0.0.0.0 --port 8003
# Standard-Start (Port 8010)
poetry run uvicorn apps.simulator.main:app --host 0.0.0.0 --port 8010
# Mit Auto-Reload für Entwicklung
poetry run uvicorn apps.simulator.main:app --host 0.0.0.0 --port 8003 --reload
poetry run uvicorn apps.simulator.main:app --host 0.0.0.0 --port 8010 --reload
# Im Hintergrund
poetry run uvicorn apps.simulator.main:app --host 0.0.0.0 --port 8003 > /tmp/simulator.log 2>&1 &
poetry run uvicorn apps.simulator.main:app --host 0.0.0.0 --port 8010 > /tmp/simulator.log 2>&1 &
```
### Docker Container
#### Build Image
```bash
docker build -t simulator:dev -f apps/simulator/Dockerfile .
```
#### Run Container
```bash
docker run --rm -p 8010:8010 \
-e MQTT_BROKER=172.16.2.16 \
-e MQTT_PORT=1883 \
-e SIM_PORT=8010 \
simulator:dev
```
#### Environment Variables
| Variable | Default | Description |
|----------|---------|-------------|
| `MQTT_BROKER` | `172.16.2.16` | MQTT broker hostname/IP |
| `MQTT_PORT` | `1883` | MQTT broker port |
| `SIM_PORT` | `8010` | Port for web interface |
## Web-Interface
Öffne im Browser:
```
http://localhost:8003
http://localhost:8010
```
### Features im Dashboard