Skip to content

Commit

Permalink
Apply lessons learned after running the first House application in a …
Browse files Browse the repository at this point in the history
…container
  • Loading branch information
pascal-fb-martin committed Nov 20, 2021
1 parent c101cac commit d3c7aa8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM debian:stable-slim
COPY . /
RUN apt-get update && apt-get --yes install ca-certificates openssl
ENTRYPOINT [ "/usr/local/bin/waterwise" ]
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,17 @@ uninstall:
purge: uninstall
rm -rf /etc/default/waterwise

docker: all
rm -rf build
mkdir -p build
cp Dockerfile build
mkdir -p build/usr/local/bin
cp waterwise build/usr/local/bin
chmod 755 build/usr/local/bin/waterwise
mkdir -p build/usr/local/share/house/public/waterwise
cp public/* build/usr/local/share/house/public/waterwise
chmod 644 build/usr/local/share/house/public/waterwise/*
cp /usr/local/share/house/public/house.css build/usr/local/share/house/public
chmod 644 build/usr/local/share/house/public/house.css
cd build ; docker build -t waterwise .
rm -rf build
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ The timestamp field represents the time of the request, the host field represent
The origin field represent the URL used to obtain the index. The state field is either 'u' (not yet initialized), 'f' (failed to access the bewaterwise.com web site), 'e' (malformed JSON data received) or 'a' (active). Except when active, an error field provides a description of the error.

The index field is a percentage (which can be above 100), the received field indicate when this index was obtained, and the calculated field indicates when the bewaterwise.com site calculated the index. (This service use the weekly index.)

## Docker

The project supports a Docker container build, which was tested on an ARM board running Debian. To make it work, all the house containers should be run in host network mode (`--network` host option). This is because of the way [houseportal](https://github.com/pascal-fb-martin/houseportal) manages access to each service: using dynamically assigned ports does not mesh well with Docker's port mapping.

0 comments on commit d3c7aa8

Please sign in to comment.