⚠️ Replaced by OpenFn/lightning
Supported by OpenFn, DIAL, UNICEF, and with UK aid from the British people.
🔥 The documentation for this project can be found at docs.openfn.org. 🔥
`docker build -t openfn/microservice:<version> .`Assuming you've got an .env and a project directory with a project.yaml
spec:
docker-compose updocker run -v <path-to-your-project-folder>:/home/microservice/<path-to-your-project-folder> \
--env-file <path-to-your-env-file> \
--network host \
openfn/microservice:<version>First ensure you have cloned this repository, then from the
instant folder (the folder where you'd
typically run your "Instant OpenHIE commands") run the following command:
yarn docker:instant init openfnMicroservice --custom-package="<path to this folder>"
Test the deployment by posting messages to port 4001.
- It's recommended to use
nvmto install NodeJs. At the time of writing, theplatform-appinstance on US servers and the dockerizedmicroserviceinstance are running on NodeJsv12.20.2. - It's highly recommended to use
asdffor managing your Erlang and Elixir versions. After installingasdf, install Erlang and Elixir. asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.gitasdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git- At the time of writing, we're using
Erlang/OTP 23 [erts-11.1.8]andElixir 1.11.3 (compiled with Erlang/OTP 23) - Also at the time of writing, we're assuming that logs are ingested by a host service so we don't depend on a database!
- Once NodeJs, Erlang and Elixir are installed, proceed to the application build/setup section below.
- Clone this repo with
git clone [email protected]:OpenFn/microservice.git - Enter the directory with
cd microservice - Install dependencies with
mix setup - Run the tests with
mix test - Make a project directory to hold your project artifacts with
mkdir sample-project - Create a new project specification with
cp project.yaml.example ./sample-project/project.yaml - Create a
.envfile withcp .env.example .env - Install necessary adaptors via
npm install @openfn/language-http --prefix priv/openfn/runtime/node_modules --no-save --no-package-lock --global-style - Start your microservice server with
env $(cat .env | grep -v "#" | xargs ) iex -S mix phx.server