Projects/Docker based pluggable webservices for RPI: Difference between revisions

From Playful Exploration
Jump to navigation Jump to search
 
(6 intermediate revisions by the same user not shown)
Line 6: Line 6:


Related links:
Related links:
* [[Rpi/docker]]
* [[Rpi/Docker]]


== Project Repositories ==
== Project Repositories ==
Line 19: Line 19:
{| class="wikitable"
{| class="wikitable"
! Dockerfile                  !! Status        !! Detail
! Dockerfile                  !! Status        !! Detail
|-
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-volumes rpi-volumes]
| In progress
| Starts a docker container with access to the volumes of all other containers allowing to manage their configuration and backups.
|-
|-
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-nginx rpi-nginx]
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-nginx rpi-nginx]
| In progress
| In progress
| Starts nginx as docker service.  Still needs conf file.
| Starts nginx in a docker container.  Still needs conf file.
|-
|-
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-influxdb rpi-influxdb]
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-influxdb rpi-influxdb]
Line 32: Line 36:
| Starts Stanford's Natural Language Processor as Web Service.  Runs out of memory on RPI3.
| Starts Stanford's Natural Language Processor as Web Service.  Runs out of memory on RPI3.
|-
|-
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-grafana rpi-grafana]
| rpi-grafana
| Not started
| Not started
|  
|  
|-
|-
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-mosquitto rpi-mosquitto ]
| rpi-mosquitto
| Not started
| Not started
|  
|  
|-
|-
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-nodered rpi-nodered ]
| rpi-nodered
| Not started
| Not started
|  
|  
Line 47: Line 51:
|
|
|  
|  
|}
== Usage/Steps ==
{| class="wikitable"
! Step !! Command
|-
| Install docker
| See [https://www.playfulexploration.com/wiki/index.php?title=Install/Docker#Installation_on_Raspberian Install Docker on the RPI.]
<syntaxhighlight lang="bash" line="1">
curl https://raw.githubusercontent.com/resin-io/docker-install-script/master/install.sh | sh
docker -d &
sysctl -w net.ipv4.ip_forward=1
</syntaxhighlight>
|-
| Spawn a docker network
| <syntaxhighlight lang="bash" line="1">
docker network create nw
</syntaxhighlight>
|-
| Get rpi-docker from git
| <syntaxhighlight lang="bash" line="1">
git clone https://github.com/playfulexploration/rpi-docker.git
</syntaxhighlight>
|-
| Spawn nginx container
| <syntaxhighlight lang="bash" line="1">
docker build -t playfulexploration/rpi-nginx rpi-docker.git/rpi-nginx
docker run -d --restart=always --name nginx -h nginx --net=nw -p 80:80 -p 443:443 playfulexploration/rpi-nginx
</syntaxhighlight>
Verify the nginx service responds.  The curl command gets the html text containing nginx welcome message:
<syntaxhighlight lang="bash" line="1">
curl http://localhost
</syntaxhighlight>
Use a web-browser and navigate to your RPI.  Nginx should respond with an HTML page saying 'Welcome to nginx!'.
|-
| Spawn influxdb container
| <syntaxhighlight lang="bash" line="1">
docker build -t playfulexploration/rpi-nginx rpi-docker.git/rpi-influxdb
docker run -d --name influxdb -h influxdb --net=nw -p 8083:8083 -p 8086:8086 -e PRE_CREATE_DB="db1" playfulexploration/rpi-influxdb
</syntaxhighlight>
|}
|}

Latest revision as of 06:39, 7 September 2016

Goal

Create an extensible Nginx configuration for docker based pluggable webservices.

Create docker based web services as needed for different projects

Related links:

Project Repositories

github : https://github.com/playfulexploration/rpi-docker - Dockerfiles used to create docker images
dockerhub : https://hub.docker.com/r/playfulexploration/rpi-docker/ - Docker images

Docker Images and Status

Dockerfile Status Detail
rpi-volumes In progress Starts a docker container with access to the volumes of all other containers allowing to manage their configuration and backups.
rpi-nginx In progress Starts nginx in a docker container. Still needs conf file.
rpi-influxdb In progress Starts influxdb as docker service. Needs configuration for ease of use.
rpi-nlp On hold Starts Stanford's Natural Language Processor as Web Service. Runs out of memory on RPI3.
rpi-grafana Not started
rpi-mosquitto Not started
rpi-nodered Not started
add more here...

Usage/Steps

Step Command
Install docker See Install Docker on the RPI.
curl https://raw.githubusercontent.com/resin-io/docker-install-script/master/install.sh | sh
docker -d &
sysctl -w net.ipv4.ip_forward=1
Spawn a docker network
docker network create nw
Get rpi-docker from git
git clone https://github.com/playfulexploration/rpi-docker.git
Spawn nginx container
docker build -t playfulexploration/rpi-nginx rpi-docker.git/rpi-nginx
docker run -d --restart=always --name nginx -h nginx --net=nw -p 80:80 -p 443:443 playfulexploration/rpi-nginx

Verify the nginx service responds. The curl command gets the html text containing nginx welcome message:

curl http://localhost

Use a web-browser and navigate to your RPI. Nginx should respond with an HTML page saying 'Welcome to nginx!'.

Spawn influxdb container
docker build -t playfulexploration/rpi-nginx rpi-docker.git/rpi-influxdb
docker run -d --name influxdb -h influxdb --net=nw -p 8083:8083 -p 8086:8086 -e PRE_CREATE_DB="db1" playfulexploration/rpi-influxdb