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

Added Dockerfile #185

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
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
docs/
test/
node_modules/
.travis.yml
CONTRIBUTING.md
LICENSE
README.md
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:12.18-alpine3.9

WORKDIR /app

ENV NODE_ENV=production

COPY . .

RUN npm i --production

ENTRYPOINT [ "node", "./bin/getpapers.js" ]
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,28 @@ getpapers can fetch article metadata, fulltexts (PDF or XML), and supplementary

## Installation

### Installing nodeJS
### Using NodeJS

#### Installing NodeJS

Please follow [these cross-platform instructions](https://github.com/blahah/installing-node-tools)

### Installing getpapers
#### Installing getpapers

```bash
$ npm install --global getpapers
```

### Using Docker

#### Installing Docker
Please follow [these cross-platform instructions](https://docs.docker.com/get-docker/)

#### Building Docker image
```bash
docker build -t getpapers .
```

## Usage

Use `getpapers --help` to see the command-line help:
Expand All @@ -49,6 +61,21 @@ Use `getpapers --help` to see the command-line help:

By default, getpapers uses the EuropePMC API.

### Docker
```bash
docker run --rm -it getpapers --help
```

#### Attaching directories
Docker containers have their own isolated file system that is not accessible by user directly.
In order to get fetched files, you need to mount a local directory when you run a container:

```bash
mkdir tmp
docker run --rm -it -v "$(pwd)"/tmp:/data getpapers --query 'c4 photosynthesis flaveria' --outdir=/data
```
More about bind mounts you can find [here](https://docs.docker.com/storage/bind-mounts/).

## Screenshot

![screenshot](https://raw.githubusercontent.com/ContentMine/getpapers/master/docs/screenshot.png)
Expand Down
Loading