Skip to content
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

introduce Dockerfile to project #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Docker image for citeproc-node app

FROM node
MAINTAINER <PLEASE-INSERT-MAINTAiNER>

# append nodejs binaries TO PATH
ENV PATH node_modules/.bin:$PATH

# Add source
COPY . citeproc-js-server

WORKDIR citeproc-js-server

# fetch git submodules
RUN git submodule init
RUN git submodule update

RUN npm install

# XML to JSON for optimal performance
RUN ./xmltojson.py ./csl ./csl-json
RUN ./xmltojson.py ./csl-locales ./csl-locales-json

# Override configuration to match above paths
ADD docker/local.json config/local.json

# Expose port
EXPOSE 8085

# run app
CMD ["npm", "start"]
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ Also note that the citation server automatically watches the style and locale di
to automatically use the new versions when they're pulled. This is subject to [platform
caveats](https://nodejs.org/api/fs.html#fs_caveats)

## Setting up citeproc-js-server using docker

With docker running the citeproc-js-server is easy. Just execute the command

```
docker run -d -p 8085:8085 <INSERT-OFFICIAL-NAME>
```

## Setting up citeproc-js-server

### Step 1
Expand All @@ -49,7 +57,7 @@ If all is well, you will see:
info Server running at http://127.0.0.1:8085
```

### Step 3
## Test your citeproc-js-server

Now to test the server using the sampledata.json file provided in the
citeproc-js-server sources. Try posting it to your server, from a separate
Expand Down
12 changes: 12 additions & 0 deletions docker/local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"port" : 8085,
"logLevel" : "info",
"localesPath" : "./csl-locales-json",
"cslPath" : "./csl-json",
"renamedStylesPath": "./csl/renamed-styles.json",
"cslDependentPath": "./csl/dependent",
"engineCacheSize" : 40,
"timings": false,
"debug": true,
"userAgent": "Zotero Citation Server (https://github.com/zotero/citeproc-js-server)"
}