Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker image build from official Postgres image #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

61131
Copy link

@61131 61131 commented May 1, 2024

This PR includes a Dockerfile and entry point script required to produce a combined mqtt-pg-logger/Postgres image.

Standard parameters are configurable through environment variables as per the official Postgres image. Additionally the MQTT broker address can be set through the environment variable MQTT_BROKER.

This image can be pulled from https://hub.docker.com/r/robcasey/mqtt-pg-logger.

Added Dockerfile for creation of mqtt-pg-logger/postgres image
@agritheory
Copy link

@61131 I'd like to try this out, what are you running for the Docker command? Maybe worth adding that to the readme as well.

@61131
Copy link
Author

61131 commented Aug 29, 2024

@agritheory - This image inherits environment configuration options from the base Postgres image and adds an additional environment variable for the MQTT broker to which the logging client should connect. In my local testing where my MQTT server was running on host 10.0.0.1, I used the following docker command line to run the container.

docker run --name test-mqtt-pg-logger -p 5432:5432 -e MQTT_BROKER=10.0.0.1 -d robcasey/mqtt-pg-logger:latest

This will start the container running Postgres and the mqtt-pg-logger script, attempting to connect it to MQTT broker/server on host 10.0.0.1. All messages received by the mqtt-pg-logger client will then be logged to the database. The 5432:5432 port definition then allows me to connect to the Postgres database with other database tools (like DBeaver) to review collected message data.

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants