Merge pull request #11 from Meatballs1/docker
Add Dockerfile and compose.yaml to containerize if required
This commit is contained in:
16
Dockerfile
Normal file
16
Dockerfile
Normal 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"]
|
||||
@@ -41,7 +41,13 @@ Installing `sslpsk` needs some extra steps:
|
||||

|
||||
|
||||
```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
6
compose.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
services:
|
||||
app:
|
||||
build: .
|
||||
restart: on-failure
|
||||
volumes:
|
||||
- ./config:/config
|
||||
0
config/.gitkeep
Normal file
0
config/.gitkeep
Normal file
Reference in New Issue
Block a user