Skip to content

Commit

Permalink
use new stencila/package.json in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
minrk committed May 10, 2018
1 parent af8749b commit e31336d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ RUN mkdir -p ${STENCILA_DIR} && chown -R ${NB_USER} ${STENCILA_DIR}
# install Stencila as NB_USER
USER ${NB_USER}
WORKDIR ${STENCILA_DIR}
RUN git clone --depth 1 https://github.com/stencila/stencila.git ${STENCILA_DIR}
ADD package.json package.json
RUN npm install
ADD stencila.js stencila.js

WORKDIR ${HOME}
ADD requirements.txt /tmp/requirements.txt
Expand Down
17 changes: 7 additions & 10 deletions jupyter_notebook_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@ class StencilaProxyHandler(SuperviseAndProxyHandler):

name = 'stencila'

def get_env(self):
return {
'STENCILA_PORT': str(self.port),
'STENCILA_ARCHIVE_DIR': self.state['notebook_dir'],
}

def get_cmd(self):
cmd = ' '.join(map(pipes.quote, [
'node',
'make',
'-w',
'-s',
'-d',
self.state['notebook_dir'],
]))
return [
'sh', '-c', 'cd "$STENCILA_DIR"; ' + cmd,
'sh', '-c', 'cd "$STENCILA_DIR"; node stencila.js',
]


Expand All @@ -29,7 +27,6 @@ def add_handlers(app):
app.base_url + 'stencila/(.*)',
StencilaProxyHandler,
dict(state=dict(
port=4000,
notebook_dir=app.notebook_dir,
)),
),
Expand Down
2 changes: 1 addition & 1 deletion stencila.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const darServer = require("dar-server");
const express = require("express");

const port = parseInt(process.env.STENCILA_PORT || '4000');
const archiveDir = process.env.STENCILA_DIR || process.env.HOME;
const archiveDir = process.env.STENCILA_ARCHIVE_DIR || process.env.HOME;

const server = express();

Expand Down

0 comments on commit e31336d

Please sign in to comment.