Merge branch 'main' into clean-as-scripts
commit
87ac3e714e
45
README.md
45
README.md
|
@ -6,21 +6,22 @@ The OAPEN Suggestion Service uses natural-language processing to suggest books b
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
- [Installation (Server)](#installation-server)
|
* [Installation (Server)](#installation-server)
|
||||||
- [DigitalOcean Droplet](#digitalocean-droplet)
|
+ [DigitalOcean Droplet](#digitalocean-droplet)
|
||||||
- [DigitalOcean Managed Database](#digitalocean-managed-database)
|
+ [DigitalOcean Managed Database](#digitalocean-managed-database)
|
||||||
- [Setup Users & Install Requirements](#setup-users--install-requirements)
|
+ [Setup Users & Install Requirements](#setup-users--install-requirements)
|
||||||
- [Clone & Configure the Project](#clone--configure-the-project)
|
+ [Clone & Configure the Project](#clone--configure-the-project)
|
||||||
- [SSL Certificate](#ssl-certificate)
|
+ [SSL Certificate](#ssl-certificate)
|
||||||
- [Running](#running)
|
* [Running](#running)
|
||||||
- [Endpoints](#endpoints)
|
* [Endpoints](#endpoints)
|
||||||
- [Service Components](#service-components)
|
* [Logging](#logging)
|
||||||
- [Suggestion Engine](#suggestion-engine)
|
* [Service Components](#service-components)
|
||||||
- [API](#api)
|
+ [Suggestion Engine](#suggestion-engine)
|
||||||
- [Embed Script](#embed-script)
|
+ [API](#api)
|
||||||
- [Web Demo](#web-demo)
|
+ [Embed Script](#embed-script)
|
||||||
- [Updates](#updates)
|
+ [Web Demo](#web-demo)
|
||||||
- [Local Installation (No Server)](#local-installation-no-server)
|
* [Updates](#updates)
|
||||||
|
* [Local Installation (No Server)](#local-installation-no-server)
|
||||||
|
|
||||||
## Installation (Server)
|
## Installation (Server)
|
||||||
|
|
||||||
|
@ -193,6 +194,18 @@ The API provides access to the following endpoints:
|
||||||
- e.g. http://localhost:3001/api/20.400.12657/47581/?threshold=5
|
- e.g. http://localhost:3001/api/20.400.12657/47581/?threshold=5
|
||||||
- `http://localhost:3001/api/{handle}/ngrams`
|
- `http://localhost:3001/api/{handle}/ngrams`
|
||||||
- e.g. http://localhost:3001/api/20.400.12657/47581/ngrams
|
- e.g. http://localhost:3001/api/20.400.12657/47581/ngrams
|
||||||
|
|
||||||
|
## Logging
|
||||||
|
|
||||||
|
Log files are automatically generated by Docker for each container. The log files can be found in `/var/lib/docker/containers/<container-id>/*-json.log`.
|
||||||
|
|
||||||
|
To find a container's id, run `docker ps -a`.
|
||||||
|
|
||||||
|
To view log files, run `tail -f /var/lib/docker/containers/<container-id>/*-json.log`.
|
||||||
|
|
||||||
|
After some time, log files may take up too much disk space. To clear all logs on the host machine, run `truncate -s 0 /var/lib/docker/containers/*/*-json.log`
|
||||||
|
|
||||||
|
To clear logs for a specific container, run `truncate -s 0 /var/lib/docker/containers/<container-id>/*-json.log`
|
||||||
|
|
||||||
## Service Components
|
## Service Components
|
||||||
|
|
||||||
|
@ -296,5 +309,5 @@ Configuration info for the web demo is in [`web/README.md`](web/README.md).
|
||||||
POSTGRES_PASSWORD=<Password of the postgres user>
|
POSTGRES_PASSWORD=<Password of the postgres user>
|
||||||
POSTGRES_SSLMODE=<'allow' for a local installation>
|
POSTGRES_SSLMODE=<'allow' for a local installation>
|
||||||
```
|
```
|
||||||
|
|
||||||
4. See [Running](#running)
|
4. See [Running](#running)
|
||||||
|
|
|
@ -2,6 +2,7 @@ version: "3.8"
|
||||||
services:
|
services:
|
||||||
oapen-engine :
|
oapen-engine :
|
||||||
build: ./oapen-engine/
|
build: ./oapen-engine/
|
||||||
|
restart: always
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
environment:
|
environment:
|
||||||
|
@ -10,24 +11,21 @@ services:
|
||||||
- HARVEST_PERIOD=604800 # weekly
|
- HARVEST_PERIOD=604800 # weekly
|
||||||
api:
|
api:
|
||||||
build: ./api/
|
build: ./api/
|
||||||
|
restart: always
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
expose:
|
|
||||||
- ${API_PORT}
|
|
||||||
ports:
|
ports:
|
||||||
- "0.0.0.0:${API_PORT}:${API_PORT}"
|
- "0.0.0.0:${API_PORT}:${API_PORT}"
|
||||||
web:
|
web:
|
||||||
build: ./web/
|
build: ./web/
|
||||||
expose:
|
restart: always
|
||||||
- ${WEB_DEMO_PORT}
|
|
||||||
ports:
|
ports:
|
||||||
- "0.0.0.0:${WEB_DEMO_PORT}:${WEB_DEMO_PORT}"
|
- "0.0.0.0:${WEB_DEMO_PORT}:3000"
|
||||||
embed-script-test:
|
embed-script-test:
|
||||||
build: ./embed-script/
|
build: ./embed-script/
|
||||||
expose:
|
restart: always
|
||||||
- ${EMBED_SCRIPT_PORT}
|
|
||||||
ports:
|
ports:
|
||||||
- "0.0.0.0:${EMBED_SCRIPT_PORT}:${EMBED_SCRIPT_PORT}"
|
- "0.0.0.0:${EMBED_SCRIPT_PORT}:3002"
|
||||||
volumes:
|
volumes:
|
||||||
db:
|
db:
|
||||||
driver: local
|
driver: local
|
||||||
|
|
Loading…
Reference in New Issue