nestwatcher
nestwatcher copied to clipboard
Docker-compose
It would be great if there is a docker-compose file. So we can create a container for nestwatcher.
script for loop / waitime
` from datetime import datetime from time import sleep import os intervall = int(os.environ['INTERVALL']) try: while True: payload = datetime.now().strftime('%Y-%m-%d %H:%M:%S') print("Ausgeführt am: " + payload) os.system("python3 ./nests.py") sleep(intervall * 60 * 60) finally: print("Script Ende");
`
Dockerfile ` FROM python:3
WORKDIR /usr/src/app
COPY requirements.txt ./
RUN pip3 install --no-cache-dir -r requirements.txt
COPY . .
CMD ["python", "./start.py"] `
docker-compose.yml ` nestw: build: ./nestwatcher container_name: NestWatcher restart: unless-stopped environment: INTERVALL: 6 volumes: - ./nestwatcher/nest.json:/usr/src/app/nest.json - ./nestwatcher/config:/usr/src/app/config
`