Merge branch 'main' into clean-as-scripts
commit
87ac3e714e
43
README.md
43
README.md
|
@ -6,21 +6,22 @@ The OAPEN Suggestion Service uses natural-language processing to suggest books b
|
|||
|
||||
## Table of Contents
|
||||
|
||||
- [Installation (Server)](#installation-server)
|
||||
- [DigitalOcean Droplet](#digitalocean-droplet)
|
||||
- [DigitalOcean Managed Database](#digitalocean-managed-database)
|
||||
- [Setup Users & Install Requirements](#setup-users--install-requirements)
|
||||
- [Clone & Configure the Project](#clone--configure-the-project)
|
||||
- [SSL Certificate](#ssl-certificate)
|
||||
- [Running](#running)
|
||||
- [Endpoints](#endpoints)
|
||||
- [Service Components](#service-components)
|
||||
- [Suggestion Engine](#suggestion-engine)
|
||||
- [API](#api)
|
||||
- [Embed Script](#embed-script)
|
||||
- [Web Demo](#web-demo)
|
||||
- [Updates](#updates)
|
||||
- [Local Installation (No Server)](#local-installation-no-server)
|
||||
* [Installation (Server)](#installation-server)
|
||||
+ [DigitalOcean Droplet](#digitalocean-droplet)
|
||||
+ [DigitalOcean Managed Database](#digitalocean-managed-database)
|
||||
+ [Setup Users & Install Requirements](#setup-users--install-requirements)
|
||||
+ [Clone & Configure the Project](#clone--configure-the-project)
|
||||
+ [SSL Certificate](#ssl-certificate)
|
||||
* [Running](#running)
|
||||
* [Endpoints](#endpoints)
|
||||
* [Logging](#logging)
|
||||
* [Service Components](#service-components)
|
||||
+ [Suggestion Engine](#suggestion-engine)
|
||||
+ [API](#api)
|
||||
+ [Embed Script](#embed-script)
|
||||
+ [Web Demo](#web-demo)
|
||||
* [Updates](#updates)
|
||||
* [Local Installation (No Server)](#local-installation-no-server)
|
||||
|
||||
## Installation (Server)
|
||||
|
||||
|
@ -194,6 +195,18 @@ The API provides access to the following endpoints:
|
|||
- `http://localhost:3001/api/{handle}/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
|
||||
|
||||
This project is a monorepo, with multiple services that work in tandem to provide suggestions:
|
||||
|
|
|
@ -2,6 +2,7 @@ version: "3.8"
|
|||
services:
|
||||
oapen-engine :
|
||||
build: ./oapen-engine/
|
||||
restart: always
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
|
@ -10,24 +11,21 @@ services:
|
|||
- HARVEST_PERIOD=604800 # weekly
|
||||
api:
|
||||
build: ./api/
|
||||
restart: always
|
||||
env_file:
|
||||
- .env
|
||||
expose:
|
||||
- ${API_PORT}
|
||||
ports:
|
||||
- "0.0.0.0:${API_PORT}:${API_PORT}"
|
||||
web:
|
||||
build: ./web/
|
||||
expose:
|
||||
- ${WEB_DEMO_PORT}
|
||||
restart: always
|
||||
ports:
|
||||
- "0.0.0.0:${WEB_DEMO_PORT}:${WEB_DEMO_PORT}"
|
||||
- "0.0.0.0:${WEB_DEMO_PORT}:3000"
|
||||
embed-script-test:
|
||||
build: ./embed-script/
|
||||
expose:
|
||||
- ${EMBED_SCRIPT_PORT}
|
||||
restart: always
|
||||
ports:
|
||||
- "0.0.0.0:${EMBED_SCRIPT_PORT}:${EMBED_SCRIPT_PORT}"
|
||||
- "0.0.0.0:${EMBED_SCRIPT_PORT}:3002"
|
||||
volumes:
|
||||
db:
|
||||
driver: local
|
||||
|
|
Loading…
Reference in New Issue