This Docker image contains a simple PHP service that publishes a "Hello World from PHP and MQTT" message to an MQTT broker.
The image contains the following files and configurations:
To run the program on your machine, make sure Docker is installed. Then, follow these steps:
docker run -p 8080:8080 kamartinez/mqtt-php-app:v1
**Access the MQTT Service**: Once the container is running, the message "Hello World from PHP and MQTT" will be automatically published to the specified MQTT broker. To verify, you can use an MQTT client or check Docker logs to see if the message was successfully published.
Using an MQTT Client to Verify:With an MQTT client, you can subscribe to the topic specified in the PHP code (e.g., test/topic) and see the published message. If you use mosquitto_sub (from the Mosquitto MQTT tools), the command would be:
```bash
mosquitto_sub -h mqtt.eclipse.org -t 'test/topic'
Content type
Image
Digest
sha256:ec6d667bf…
Size
209.5 MB
Last updated
almost 2 years ago
docker pull kamartinez/mqtt-php-app:v1