From 221bd81fe3306ab5fd44fab473e4c6ab98b7c0a6 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 30 Jul 2023 13:39:38 -0500 Subject: [PATCH] docker instructions --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/README.md b/README.md index 82b514c..842ac31 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,42 @@ # room_control +## Running with Docker + +Needs to have a `requirements.txt` file in the same directory as the `Dockerfile` + +```dockerfile +FROM python:3.10 + +# install order matters because of some weird dependency stuff with websocket-client +# install appdaemon first because it's versioning is more restrictive +RUN pip install git+https://github.com/AppDaemon/appdaemon@dev + +ENV CONF=/conf +RUN mkdir $CONF +COPY ./requirements.txt ${CONF} +RUN --mount=type=cache,target=/root/.cache/pip pip install -r ${CONF}/requirements.txt +``` + +```yaml +version: "3.8" +services: + appdaemon: + container_name: appdaemon + image: acockburn/appdaemon:dev + volumes: + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + - config:/conf + ports: + - 5050:5050 + restart: unless-stopped + + +volumes: + config: + driver: local + driver_opts: + o: bind + type: none + device: ./ +```