Skip to content

Latest commit

 

History

History
58 lines (40 loc) · 2.18 KB

README-docker.md

File metadata and controls

58 lines (40 loc) · 2.18 KB

Docker setup

This repo contains the Docker setup for building a single debian-slim container with the libgovarnam.so shared lib, varnamcli, varnamd-govarnam (HTTP server) compiled with glibc.

Running the remote image

A pre-compiled Docker image is available on the GitHub registry. This is the simplest way to run the server (port 8123 by default).

Download config.toml and edit it.

Run:

docker run -e VARNAM_LEARNINGS_DIR=/varnamd/learnings -e VARNAM_VST_DIR=/varnamd/vst \
	-v $(pwd)/config.toml:/varnamd/config.toml \
	-v $(pwd)/data/learnings/:/varnamd/learnings/ \
	-v $(pwd)/data/vst/:/varnamd/vst/ \
	-v $(pwd)/data/input/:/varnamd/input/ \
	-p 8123:8123 \
	--name varnamd ghcr.io/varnamproject/varnamd:latest

PS: Add the -d flag to docker run to run the server in the background.

Building the image locally

  • Download the Dockerfile
  • Run docker build -t varnamd . to build an image named varnamd locally.

Running the local image

Download config.toml and edit it.

docker run -e VARNAM_LEARNINGS_DIR=/varnamd/learnings -e VARNAM_VST_DIR=/varnamd/vst \
	-v $(pwd)/config.toml:/varnamd/config.toml \
	-v $(pwd)/data/learnings/:/varnamd/learnings/ \
	-v $(pwd)/data/vst/:/varnamd/vst/ \
	-v $(pwd)/data/input/:/varnamd/input/ \
	-p 8123:8123 \
	--name varnamd varnamd

Importing words

Read this doc to learn more on teaching words to Varnam.

The image comes with varnamcli that can be used for training. Varnam dictionary is stored in the host mounted ./data/learnings directory.

  • Run the varnamd container.
  • Ensure that the necessary scheme (-s flag) VST file is present in the local ./data/vst directory.
  • Copy the files needed for learning to ./data/input, eg: ./data/input/yourfile.txt

Then run:

docker exec varnamd varnamcli -s ml -learn-from-file /govarnam/input/yourfile.txt