Permalink
Browse files

Make dockerfile build from source + entrypoint

Why:

 * users would like to use hass-cli without installing python

This change addreses the need by:

 * use dockerfile and have entrypoint so you can run it
   as `docker run -e HASS_TOKEN -e HASS_SERVER <org>/home-assistant-cli <cmd line args>`
  • Loading branch information...
maxandersen committed Feb 7, 2019
1 parent 2b00bd7 commit b7f876420df65b07a6b2a99c0e7dc7635711c1cd
Showing with 26 additions and 3 deletions.
  1. +15 −0 .dockerignore
  2. +11 −3 Dockerfile
@@ -0,0 +1,15 @@
# General files
.git
.github
config

# Test related files
.tox

# Other virtualization methods
venv
.vagrant

# Temporary files
**/__pycache__
.#*
@@ -1,5 +1,13 @@
FROM python:3.7-alpine
LABEL maintainer="Max Rydahl Andersen <max@xam.dk>"

RUN apk add --no-cache --virtual build-dependencies gcc musl-dev
RUN pip3 install --no-cache-dir homeassistant-cli==0.4.4
RUN apk del build-dependencies
WORKDIR /usr/src/app

COPY . .

RUN apk add --no-cache --virtual build-dependencies gcc musl-dev\
&& rm -rf /var/cache/apk/*

RUN pip3 install --no-cache-dir -e .

ENTRYPOINT ["hass-cli"]

0 comments on commit b7f8764

Please sign in to comment.