forked from domoticz/domoticz-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
147 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 . | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "$@" |