|
| 1 | +# Dockerfile for development |
| 2 | +# Based on the production Dockerfile, but with development additions. |
| 3 | +# Keep this file as close as possible to the production Dockerfile, so the environments match. |
| 4 | + |
| 5 | +FROM python:3.5 |
| 6 | +MAINTAINER Paulus Schoutsen <Paulus@PaulusSchoutsen.nl> |
| 7 | + |
| 8 | +VOLUME /config |
| 9 | + |
| 10 | +RUN mkdir -p /usr/src/app |
| 11 | +WORKDIR /usr/src/app |
| 12 | + |
| 13 | +RUN pip3 install --no-cache-dir colorlog cython |
| 14 | + |
| 15 | +# For the nmap tracker, bluetooth tracker, Z-Wave, tellstick |
| 16 | +RUN echo "deb http://download.telldus.com/debian/ stable main" >> /etc/apt/sources.list.d/telldus.list && \ |
| 17 | + wget -qO - http://download.telldus.se/debian/telldus-public.key | apt-key add - && \ |
| 18 | + apt-get update && \ |
| 19 | + apt-get install -y --no-install-recommends nmap net-tools cython3 libudev-dev sudo libglib2.0-dev bluetooth libbluetooth-dev \ |
| 20 | + libtelldus-core2 && \ |
| 21 | + apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
| 22 | + |
| 23 | +COPY script/build_python_openzwave script/build_python_openzwave |
| 24 | +RUN script/build_python_openzwave && \ |
| 25 | + mkdir -p /usr/local/share/python-openzwave && \ |
| 26 | + ln -sf /usr/src/app/build/python-openzwave/openzwave/config /usr/local/share/python-openzwave/config |
| 27 | + |
| 28 | +COPY requirements_all.txt requirements_all.txt |
| 29 | +RUN pip3 install --no-cache-dir -r requirements_all.txt && \ |
| 30 | + pip3 install --no-cache-dir mysqlclient psycopg2 uvloop |
| 31 | + |
| 32 | +# BEGIN: Development additions |
| 33 | + |
| 34 | +# Install nodejs |
| 35 | +RUN curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash - && \ |
| 36 | + apt-get install -y nodejs |
| 37 | + |
| 38 | +# Install tox |
| 39 | +RUN pip3 install --no-cache-dir tox |
| 40 | + |
| 41 | +# Copy over everything required to run tox |
| 42 | +COPY requirements_test.txt . |
| 43 | +COPY setup.cfg . |
| 44 | +COPY setup.py . |
| 45 | +COPY tox.ini . |
| 46 | +COPY homeassistant/const.py homeassistant/const.py |
| 47 | + |
| 48 | +# Get all dependencies |
| 49 | +RUN tox -e py35 --notest |
| 50 | + |
| 51 | +# END: Development additions |
| 52 | + |
| 53 | +# Copy source |
| 54 | +COPY . . |
| 55 | + |
| 56 | +CMD [ "python", "-m", "homeassistant", "--config", "/config" ] |
0 commit comments