Skip to content

Conversation

@Dashlorde
Copy link
Collaborator

No description provided.

@empeje
Copy link
Contributor

empeje commented Feb 12, 2018

Congrats @Dashlorde 🎉

Copy link
Contributor

@empeje empeje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good, could you create README.md and a demo?

@@ -0,0 +1,25 @@
FROM node:6.11-alpine

LABEL MAINTAINER Yunlu Zhou <zhouyunlu0216@ole.org>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add me and @dogi for the future support

@empeje
Copy link
Contributor

empeje commented Feb 13, 2018

Will test it today and merge it if its good, again congrats @Dashlorde

Copy link
Contributor

@empeje empeje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just realize that there are some unnecessary things there, will review your code again

image: treehouses/bell:node-latest
ports:
- "80:80"
environment:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think all these environments necessary

@empeje
Copy link
Contributor

empeje commented Mar 9, 2018

Related to #1

Copy link
Contributor

@empeje empeje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reduce hardcoded stuffs.

* Bell. It is bell app container build with node.js.
* Couchdb. It is the database container which is initiated with `db-init`.

## How to use
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just create https://hub.docker.com/r/treehouses/bell/ and we can actually push the prebuilt image to there.

The readme should contain how to built it manually and how to use the ready-to-go image.

WORKDIR /app/server/src

COPY server.js ./
COPY package.json ./
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use original .package.json?


ENV version '0.13.21'

RUN mkdir -p /app/server/src
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to do mkdir -p /app/server/src since it will create new layer. Just do the WORKDIR here.


PortJack.get(/^(.+)$/, function(req, res) {
var options = {
"127.0.0.1": "http://127.0.0.1:2200/apps/_design/bell/MyApp/index.html",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The address should set by dynamically and specified by the environment variable.

if (options.hasOwnProperty(req.hostname)) {
res.setHeader('Location', options[req.hostname])
} else {
res.setHeader('Location', 'http://docker.ole.org:2200/apps/_design/bell/MyApp/index.html')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The address should set by dynamically and specified by the environment variable.

@empeje
Copy link
Contributor

empeje commented Mar 13, 2018

Can you create a screenshot of the working bell docker on your machine?
I have limited time to test your setup, but your demonstration will help the review process.

@Dashlorde
Copy link
Collaborator Author

steps to set up on local machine:

  1. /bin/bash build.sh to build images
  2. docker-compose up to run container

The address is localhost or 127.0.0.1 which is specified in docker-compose.yml file
screen shot 2018-03-13 at 3 26 23
screen shot 2018-03-13 at 3 26 49

@empeje
Copy link
Contributor

empeje commented Mar 14, 2018

Awesome @Dashlorde

Copy link
Member

@dogi dogi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Dashlorde good job - some change wishes ;)

@@ -0,0 +1,62 @@
# Bell
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readme.md should be README.md

wget -O BeLL-Apps-${version}.tar.gz \
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/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... until here


PortJack.get(/^(.+)$/, function(req, res) {

res.setHeader('Location', 'http://' + HOST + ':2200/apps/_design/bell/MyApp/index.html')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use standard port 5984

fi

# Default port for CouchDB accessed from host machine is 2200
PORT=${PORT:-2200}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use standard port 5984 and not 2200


RUN mkdir -p /app/server/src && \
apk add --update openssl && npm install express && \
wget -O BeLL-Apps-${version}.tar.gz \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed ...

@@ -0,0 +1,24 @@
FROM node:6.11-alpine
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dockerfile should be Dockerfile

- 5984
image: klaemo/couchdb
ports:
- "2200:5984"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no 2200 please just use 5984

image: klaemo/couchdb
ports:
- "2200:5984"
- "2201:5986"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed

- 5984
image: klaemo/couchdb
ports:
- "2200:5984"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use 5984 not 2200

image: klaemo/couchdb
ports:
- "2200:5984"
- "2201:5986"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed with klaemo

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.

4 participants