Skip to content

Commit

Permalink
Merge pull request #173 from LBAB-Humboldt/release-1.5.0
Browse files Browse the repository at this point in the history
Release 1.5.0
  • Loading branch information
erikasv committed Mar 10, 2020
2 parents c1298dc + 36ef94e commit d538a07
Show file tree
Hide file tree
Showing 6 changed files with 1,743 additions and 1,696 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v8.12.0
v9.4.0
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ COPY --chown=node:node . /home/node/app

RUN npm install && npm cache clean --force
RUN npm run build
RUN echo "{}" > dist/server/config/config.json

EXPOSE 3000
CMD [ "npm", "start" ]
41 changes: 40 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,41 @@
# BioModelos
NoSQL DB for LBA_IAvH.

The API handles all operations related with models, species and records of the BioModelos platform.

## Requirements
* Nodejs v9.4+
* npm v6.4+
* MongoDB database running v3.6

### For deployment
* Docker v18+

## DEV

### Install dependencies
After cloning the project, install its dependencies running: `npm i`

### Setup
Copy [config_template.json](src/config/config_template.json) file in the same location and set up database credentials and server configuration values. Name this file `config.json`.

### Run
Run `npm run dev` to start the server, this will launch nodemon, ready to watch your changes.

# Deployment

Deployment is made with docker, you'll need Docker v17.05.0+ and docker compose v1.17.1+

### Build image

To build the image run: `docker build -t biomodelos_api:<version> .`

It is recommended to use the [current release](https://github.com/LBAB-Humboldt/biomodelos_db_api/releases) for the image tag version.

### Deploy container

> If you set the `NODE_ENV` var to "production" in the container it will create the folder `/home/node/app/logs` to store the logs. Its recommended to link the logs folder inside the container to a folder in the host machine.
To deploy the container in port 3000 run:
```
docker run --name biomodelos_api -p 3000:3000 -v ./src/config/config.json:/home/node/app/dist/server/config/config.json -v ./logs:/home/node/app/logs -e NODE_ENV=production -d biomodelos_api:<version>
```
Loading

0 comments on commit d538a07

Please sign in to comment.