Skip to content

Commit

Permalink
Dockerfile integrated in main repo
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob committed Sep 25, 2014
1 parent 38ed025 commit e8a5fa1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3-onbuild
MAINTAINER Paulus Schoutsen <Paulus@PaulusSchoutsen.nl>

# Initialize the submodules
RUN git submodule init && git submodule update --recursive

VOLUME /config

EXPOSE 8123

CMD [ "python", "./start.py", "--docker" ]
19 changes: 17 additions & 2 deletions start.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
""" Starts home assistant with all possible functionality. """
""" Starts home assistant. """

import sys
import os

import homeassistant
import homeassistant.bootstrap

hass = homeassistant.bootstrap.from_config_file("config/home-assistant.conf")
# Within Docker we load the config from a different path
if '--docker' in sys.argv:
config_path = '/config/home-assistant.conf'
else:
config_path = 'config/home-assistant.conf'

# Ensure a config file exists to make first time usage easier
if not os.path.isfile(config_path):
with open(config_path, 'w') as conf:
conf.write("[http]\n")
conf.write("api_password=password\n")

hass = homeassistant.bootstrap.from_config_file(config_path)
hass.start()
hass.block_till_stopped()

0 comments on commit e8a5fa1

Please sign in to comment.