-
Notifications
You must be signed in to change notification settings - Fork 0
add rpi version #4
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
base: master
Are you sure you want to change the base?
Changes from 10 commits
598f592
68728db
3b3c998
1057a8b
dc2c5f4
d780575
1e755ae
b046ffd
9dc9d2b
badafbe
7104c41
32a345a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| docker build . -t treehouses/bell:rpi-latest |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| FROM hypriot/rpi-node:6.10.0-alpine | ||
|
|
||
| LABEL MAINTAINER "Dashlorde <zhouyunlu0216@gmail.com>" | ||
| LABEL MAINTAINER "Abdurrachman Mappuji <mappuji@ole.org>" | ||
| LABEL MAINTAINER "dogi <stefan@unterhauser.name>" | ||
|
|
||
| ENV version '0.13.21' | ||
|
|
||
| RUN mkdir -p /app/server/src && \ | ||
| apk add --update openssl && npm install express && \ | ||
| wget -O BeLL-Apps-${version}.tar.gz \ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not needed ... |
||
| https://github.com/open-learning-exchange/BeLL-Apps/archive/${version}.tar.gz && \ | ||
| tar xvf BeLL-Apps-${version}.tar.gz && \ | ||
| mv BeLL-Apps-${version}/* /app/server/src/ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ... until here |
||
|
|
||
| WORKDIR /app/server/src | ||
|
|
||
| COPY server.js ./ | ||
|
|
||
| RUN chmod +x ./server.js && npm install | ||
|
|
||
| EXPOSE 80 | ||
|
|
||
| CMD ["npm","start"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| var express = require('express') | ||
| var PortJack = express() | ||
| var path = require("path"); | ||
| var HOST = process.env.HOST; | ||
|
|
||
| PortJack.get(/^(.+)$/, function(req, res) { | ||
|
|
||
| res.setHeader('Location', 'http://' + HOST + ':2200/apps/_design/bell/MyApp/index.html') | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please lets not use 2200 port 5984 is couchdb standard |
||
| res.statusCode = 302 | ||
| res.end() | ||
| }) | ||
|
|
||
| PortJack.listen(80) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| docker build bell/. -t treehouses/bell:rpi-latest | ||
| docker build db-init/. -t treehouses/bell:rpi-db-init-latest |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| docker build bell/. -t bell:rpi-latest | ||
| docker build db-init/. -t bell:rpi-db-init-latest |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| docker build . -t treehouses/bell:rpi-db-init-latest |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Options are -u for username -w for passWord and -p for port number | ||
| while getopts "u:w:p:h:" option; do | ||
| case $option in | ||
| u) COUCHUSER=${OPTARG};; | ||
| w) COUCHPASSWORD=${OPTARG};; | ||
| p) PORT=${OPTARG};; | ||
| h) HOST=${OPTARG};; | ||
| esac | ||
| done | ||
|
|
||
| if [ -z "$HOST" ] | ||
| then | ||
| HOST=127.0.0.1 | ||
| fi | ||
|
|
||
| # Default port for CouchDB accessed from host machine is 2200 | ||
| PORT=${PORT:-2200} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please use for default port 5984 |
||
| if [ -z "$COUCHUSER" ] | ||
| then | ||
| COUCHURL=http://$HOST:$PORT | ||
| else | ||
| COUCHURL=http://$COUCHUSER:$COUCHPASSWORD@$HOST:$PORT | ||
| fi | ||
|
|
||
| curl -X PUT $COUCHURL/_users | ||
| curl -X PUT $COUCHURL/_replicator | ||
| curl -X PUT $COUCHURL/_global_changes | ||
|
|
||
| for database in /app/databases/*.js; do | ||
| curl -X PUT $COUCHURL/${database:15:-3} | ||
| case ${database:15:-3} in | ||
| "communities" | "languages" | "configurations" ) ;; | ||
| * ) /app/node_modules/.bin/couchapp push $database $COUCHURL/${database:15:-3} ;; | ||
| esac | ||
| done | ||
|
|
||
| ## add bare minimal required data to couchdb for launching bell-apps smoothly | ||
| for filename in /app/init_docs/languages/*.txt; do | ||
| curl -d @$filename -H "Content-Type: application/json" -X POST $COUCHURL/languages; | ||
| done | ||
| curl -d @app/init_docs/ConfigurationsDoc-Community.txt -H "Content-Type: application/json" -X POST $COUCHURL/configurations | ||
| curl -d @app/init_docs/admin.txt -H "Content-Type: application/json" -X POST $COUCHURL/members | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #!/bin/sh | ||
|
|
||
| #WAIT_TIME | ||
| while ! curl -X GET couchdb:5984/_all_dbs ; do | ||
| sleep 1 | ||
| done | ||
|
|
||
|
|
||
| #CORS SETUP | ||
| add-cors-to-couchdb http://couchdb:5984 | ||
|
|
||
| #MIGRATOR | ||
| /root/couchdb-setup.sh -p 5984 -h couchdb |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| FROM hypriot/rpi-node:6.10.0-alpine | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. name of this file should be |
||
|
|
||
| LABEL MAINTAINER "Dashlorde <zhouyunlu0216@gmail.com>" | ||
| LABEL MAINTAINER "Abdurrachman Mappuji <mappuji@ole.org>" | ||
| LABEL MAINTAINER "dogi <stefan@unterhauser.name>" | ||
|
|
||
| ENV version '0.13.21' | ||
|
|
||
| RUN apk update && \ | ||
| apk add --no-cache bash curl git jq openssl && \ | ||
| mkdir bell && wget -O bell/BeLL-Apps-${version}.tar.gz \ | ||
| https://github.com/open-learning-exchange/BeLL-Apps/archive/0.13.21.tar.gz && \ | ||
| cd bell && tar xvf BeLL-Apps-${version}.tar.gz && \ | ||
| mkdir -p /app && mv BeLL-Apps-${version}/* /app && \ | ||
| chmod +x /app/node_modules/.bin/couchapp && \ | ||
| npm install -g add-cors-to-couchdb | ||
|
|
||
| COPY docker-entrypoint.sh /root/docker-entrypoint.sh | ||
| COPY couchdb-setup.sh /root/couchdb-setup.sh | ||
|
|
||
| RUN chmod +x /root/couchdb-setup.sh | ||
|
|
||
| CMD sh /root/docker-entrypoint.sh | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| services: | ||
| couchdb: | ||
| expose: | ||
| - 5984 | ||
| image: treehouses/rpi-couchdb:2.0.0 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please use old couchdb 1.6.1 |
||
| ports: | ||
| - "2200:5984" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no 2200 just strait 5984 |
||
| - "2201:5986" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. with couchdb 1.6.1 this line is not needed |
||
| db-init: | ||
| image: treehouses/bell:rpi-db-init-latest | ||
| depends_on: | ||
| - couchdb | ||
| bell: | ||
| image: treehouses/bell:rpi-latest | ||
| ports: | ||
| - "8080:80" | ||
| environment: | ||
| - HOST=127.0.0.1 | ||
| depends_on: | ||
| - couchdb | ||
| version: "2" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| services: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as in |
||
| couchdb: | ||
| expose: | ||
| - 5984 | ||
| image: treehouses/rpi-couchdb:2.0.0 | ||
| ports: | ||
| - "2200:5984" | ||
| - "2201:5986" | ||
| db-init: | ||
| image: bell:rpi-db-init-latest | ||
| depends_on: | ||
| - couchdb | ||
| bell: | ||
| image: bell:rpi-latest | ||
| ports: | ||
| - "8080:80" | ||
| environment: | ||
| - HOST=docker.ole.org | ||
| depends_on: | ||
| - couchdb | ||
| version: "2" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name of this file should be
Dockerfilenotdockerfile