ThingSpeak server in a Singularity container.
The server needs a working MySQL database on host. Install it, add a user thing/speak and enable access to databases thingspeak_test, thingspeak_development and thingspeak_production:
sudo apt install mysql-server
sudo mysql -e "CREATE USER 'thing'@'%' IDENTIFIED WITH mysql_native_password BY 'speak';"
sudo mysql -e "GRANT ALL ON thingspeak_test.* TO 'thing'@'%';"
sudo mysql -e "GRANT ALL ON thingspeak_development.* TO 'thing'@'%';"
sudo mysql -e "GRANT ALL ON thingspeak_production.* TO 'thing'@'%';"You can build a local Singularity image named thingspeak.sif with:
sudo singularity build thingspeak.sif thingspeak.defYou can skip database setup and test on host by setting the SKIP_DB_SETUP environment variable:
sudo env SINGULARITYENV_SKIP_DB_SETUP=true singularity build thingspeak.sif thingspeak.defYou can run the server using the default run command:
singularity run thingspeak.sifor as a Singularity instance:
singularity instance start thingspeak.sif thingspeak
singularity instance list
singularity instance stop thingspeakThe server should be accessible at http://localhost:3000/.
You can override the listening port with an environment variable:
export SINGULARITYENV_LISTEN_PORT=3001
singularity run thingspeak.sifBug reports and pull requests are welcome on GitHub at https://github.com/ivanmicetic/singularity-thingspeak.
The code is available as open source under the terms of the MIT License.