Skip to content

Commit

Permalink
add pip install variant as comment to dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
benleb committed Aug 11, 2020
1 parent 7479336 commit bd21db0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions demo/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ WORKDIR /usr/src/app
# install additional packages
RUN apk add --no-cache curl tzdata

# install appdaemon
# git: install appdaemon from source
RUN apk add --virtual build git gcc libffi-dev openssl-dev musl-dev && \
git clone https://github.com/AppDaemon/appdaemon.git /usr/src/app && cd /usr/src/app && git checkout ${APPDAEMON_VERSION} && \
pip install --no-cache-dir . && \
apk del build
# # pip: install appdaemon from pypi
# RUN pip install --no-cache-dir appdaemon==${APPDAEMON_VERSION}

# bootstrap appdaemon
RUN mkdir -p conf/apps/
Expand All @@ -29,10 +31,13 @@ COPY demo/automoli.appdaemon.yaml conf/appdaemon.yaml.example
# add AutoMoLi
COPY apps/automoli conf/apps/automoli

# # pip: get start script missing in pip package from repo
# RUN wget https://raw.githubusercontent.com/AppDaemon/appdaemon/${APPDAEMON_VERSION}/dockerStart.sh && chmod +x /usr/src/app/dockerStart.sh

# patch appdaemon startup script with new env vars & show config on startup
RUN sed -i '44i\\n# AutoMoLi: env variable configuration\nif [ -n "$AUTOMOLI_ROOM" ]; then sed -i \"s/kitchen/$(echo $AUTOMOLI_ROOM | sed "s/[^[:print:]]//g")/\" $CONF/apps/apps.yaml; fi' /usr/src/app/dockerStart.sh && \
sed -i '47i# AutoMoLi: show config on startup\necho -e "\\n\\n\\033[1mAutoMoLil\\033[0m configuration in \\033[1m$CONF/apps/apps.yaml\\033[0m:\\n" && cat $CONF/apps/apps.yaml && echo -e "\\n\\n"' /usr/src/app/dockerStart.sh

# Start script
# start script
RUN chmod +x /usr/src/app/dockerStart.sh
ENTRYPOINT ["./dockerStart.sh"]

0 comments on commit bd21db0

Please sign in to comment.