Merge pull request #11 from Meatballs1/docker

Add Dockerfile and compose.yaml to containerize if required
This commit is contained in:
pmagyar
2024-03-19 13:03:39 +01:00
committed by GitHub
4 changed files with 29 additions and 1 deletions

16
Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
FROM python:3.10-slim
WORKDIR /app
COPY requirements.txt ./
RUN apt-get update && \
apt-get install -y --no-install-recommends gcc python3-dev libssl-dev && \
pip3 install -r requirements.txt && \
apt-get remove -y gcc python3-dev libssl-dev && \
apt-get autoremove -y
COPY hc2mqtt hc-login HCDevice.py HCSocket.py HCxml2json.py ./
ENTRYPOINT ["python3"]
CMD ["hc2mqtt", "/config/config.json"]

View File

@@ -41,7 +41,13 @@ Installing `sslpsk` needs some extra steps:
![laptop in a clothes washer with a display DoorState:Closed](images/doorclose.jpg)
```bash
hc-login $USERNAME $PASSWORD > config.json
hc-login $USERNAME $PASSWORD > config/config.json
```
or
```bash
docker-compose run -T app hc-login $USERNAME $PASSWORD > config/config.json
```
The `hc-login` script perfoms the OAuth process to login to your

6
compose.yaml Normal file
View File

@@ -0,0 +1,6 @@
services:
app:
build: .
restart: on-failure
volumes:
- ./config:/config

0
config/.gitkeep Normal file
View File