Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gizmocuz committed Jan 29, 2021
1 parent 7b6c938 commit ae70d8f
Show file tree
Hide file tree
Showing 4 changed files with 147 additions and 6 deletions.
56 changes: 56 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
FROM debian:buster-slim

ARG APP_HASH
ARG BUILD_DATE

LABEL org.label-schema.vcs-ref=$APP_HASH \
org.label-schema.version=$APP_HASH \
org.label-schema.vcs-url="https://github.com/domoticz/domoticz" \
org.label-schema.url="https://domoticz.com/" \
org.label-schema.name="Domoticz" \
org.label-schema.description="Domoticz open source Home Automation system" \
org.label-schema.license="GPLv3" \
org.label-schema.build-date=$BUILD_DATE \
maintainer="Domoticz Docker Maintainers <[email protected]>"

WORKDIR /opt/domoticz

RUN set -ex \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y unzip \
git \
libudev-dev \
libusb-0.1-4 \
curl libcurl4 libcurl4-gnutls-dev \
libpython3.7-dev \
&& OS="$(uname -s | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')" \
&& MACH=$(uname -m) \
&& if [ ${MACH} = "armv6l" ]; then MACH = "armv7l"; fi \
&& archive_file="domoticz_${OS}_${MACH}.tgz" \
&& version_file="version_${OS}_${MACH}.h" \
&& history_file="history_${OS}_${MACH}.txt" \
&& curl -k -L https://releases.domoticz.com/releases/beta/${version_file} --output version.h \
&& curl -k -L https://releases.domoticz.com/releases/beta/${archive_file} --output domoticz.tgz \
&& tar xfz domoticz.tgz \
&& rm domoticz.tgz \
&& apt-get remove --purge --auto-remove -y curl \
&& rm -rf /var/lib/apt/lists/*

VOLUME /config
VOLUME /opt/domoticz/plugins
VOLUME /log

EXPOSE 8080
EXPOSE 443

ENV LOG_PATH=
ENV DATABASE_PATH=
ENV WWW_PORT=8080
ENV SSL_PORT=443

COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh \
&& ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat

ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["/opt/domoticz/domoticz"]
8 changes: 4 additions & 4 deletions LICENSE → License.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Expand Down Expand Up @@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
along with this program. If not, see <http://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

Expand All @@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
<http://www.gnu.org/licenses/>.

The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
74 changes: 72 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,72 @@
# domoticz-docker
Official Domoticz Docker images
Domoticz
======

Domoticz - http://www.domoticz.com/

Docker containers with official Domoticz (beta) builds

**THIS IS A WORK IN PROGRESS AND IS NOT FINISHED YET, FEEL FREE TO HELP!**

## How to use

**Pull image**

```
docker pull domoticz/domoticz:$VERSION
```

**Run container**

```
docker run -d \
-p 8080:8080 \
-p 8443:443 \
-v <path for config files>:/config \
-v /etc/localtime:/etc/localtime:ro \
--device=<device_id> \
--name=<container name> \
domoticz/domoticz:$VERSION
```

Please replace all user variables in the above command defined by <> with the correct values (you can have several USB devices attached, just add other `--device=<device_id>`).

**Access Domoticz**

```
http://<host ip>:8080
```

8080 can be another port (you change `-p 8080:8080` to `-p 8081:8080` to have 8081 out of the container for example).

### Usage with docker-compose

```yaml
version: '3.3'

services:
domoticz:
image: domoticz/domoticz
container_name: domoticz
restart: unless-stopped
# Pass devices to container
# devices:
# - "dev/serial/by-id/usb-0658_0200-if00:/dev/ttyACM0"

volumes:
- /etc/localtime:/etc/localtime:ro
#- ./log:/var/log
#- ./config:/config
- ./plugins:/opt/domoticz/plugins
environment:
#ENV LOG_PATH=/var/log/domoticz.log
#ENV DATABASE_PATH=/config/domoticz.db
#ENV WWW_PORT=8080
#ENV SSL_PORT=443
```

### Building the image

```
docker buildx build --no-cache --platform linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/amd64 --build-arg APP_HASH="12345" --build-arg BUILD_DATE="2021-01-29T13:51:00z" --tag domoticz/domoticz .
```
15 changes: 15 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -e

CMD_ARGS="-www $WWW_PORT"
CMD_ARGS="$CMD_ARGS -sslwww $SSL_PORT"

if [ -n "$LOG_PATH" ]; then
CMD_ARGS="$CMD_ARGS -log $LOG_PATH"
fi

if [ -n "$DATABASE_PATH" ]; then
CMD_ARGS="$CMD_ARGS -dbase $DATABASE_PATH"
fi

exec "$@"

0 comments on commit ae70d8f

Please sign in to comment.