-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Stop failing if config is missing, hard to debug docker * Changing message to reflect new behaviour * Adding docker compose for eaiser development setup * Docker-compose starting mosquitto in a container that mpp-solar container can connect with * Setting the entrypoint so mpp-solar starts automatically in daemon mode. * Updating the ignore file to exclude mosquitto files * Reverting the behaviour if no config file * Adding development Dockerfile and docker-compose yaml
- Loading branch information
1 parent
2595f95
commit ac815fc
Showing
8 changed files
with
109 additions
and
2 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
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,10 @@ | ||
FROM python:latest | ||
RUN apt-get update | ||
RUN apt-get install -y pkg-config libsystemd-dev gcc | ||
|
||
RUN pip install paho-mqtt systemd-python pymongo | ||
|
||
RUN apt-get -y install libpq-dev | ||
RUN pip install psycopg2 | ||
|
||
RUN pip install mppsolar |
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,11 @@ | ||
FROM python:latest | ||
RUN apt-get update | ||
RUN apt-get install -y pkg-config libsystemd-dev gcc | ||
|
||
RUN pip install paho-mqtt systemd-python pymongo | ||
|
||
RUN apt-get -y install libpq-dev | ||
RUN pip install psycopg2 | ||
|
||
COPY . /mpp-solar/ | ||
RUN pip install -e /mpp-solar/ |
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,33 @@ | ||
services: | ||
mosquitto: | ||
image: eclipse-mosquitto | ||
network_mode: host | ||
volumes: | ||
- ./docker/mosquitto/config:/mosquitto/config | ||
- ./docker/mosquitto/data:/mosquitto/data | ||
- ./docker/mosquitto/log:/mosquitto/log | ||
|
||
mppsolar: | ||
network_mode: host | ||
devices: | ||
- /dev/hidraw0:/dev/hidraw0 | ||
volumes: | ||
#Bind over the configuration | ||
- type: bind | ||
source: ./docker/ | ||
target: /etc/mpp-solar | ||
#Bind the code | ||
- type: bind | ||
source: . | ||
target: /mpp-solar | ||
build: | ||
dockerfile: Dockerfile.development | ||
entrypoint: | ||
- mpp-solar | ||
- -C | ||
- /etc/mpp-solar/mpp-solar.conf #Available due to volume binding above | ||
- --daemon | ||
depends_on: | ||
- mosquitto | ||
|
||
|
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,28 @@ | ||
services: | ||
mosquitto: | ||
image: eclipse-mosquitto | ||
network_mode: host | ||
volumes: | ||
- ./docker/mosquitto/config:/mosquitto/config | ||
- ./docker/mosquitto/data:/mosquitto/data | ||
- ./docker/mosquitto/log:/mosquitto/log | ||
|
||
mppsolar: | ||
network_mode: host | ||
devices: | ||
- /dev/hidraw0:/dev/hidraw0 | ||
volumes: | ||
#Bind over the configuration | ||
- type: bind | ||
source: ./docker/ | ||
target: /etc/mpp-solar | ||
build: . | ||
entrypoint: | ||
- mpp-solar | ||
- -C | ||
- /etc/mpp-solar/mpp-solar.conf #Available due to volume binding above | ||
- --daemon | ||
depends_on: | ||
- mosquitto | ||
|
||
|
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,10 @@ | ||
persistence true | ||
persistence_location /mosquitto/data/ | ||
|
||
log_dest file /mosquitto/log/mosquitto.log | ||
log_type all | ||
|
||
listener 1883 | ||
## Authentication ## | ||
allow_anonymous true | ||
#password_file /mosquitto/config/mosquitto.passwd |
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,10 @@ | ||
[SETUP] | ||
pause=20 | ||
mqtt_broker=localhost | ||
|
||
[Inverter_1] | ||
port=/dev/hidraw0 | ||
protocol=PI30 | ||
command=QDI | ||
outputs=mqtt | ||
|
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