Nodejs Transformer Shell for the Flowcore Platform
10K+
This repository contains a simple example of a NodeJS Typescript Transformer. This is used for custom transformations in the Flowcore Platform
| Environment Variable | Description | Type | Default Value | Required |
|---|---|---|---|---|
| PORT | The port the service will listen on | number | 3000 | |
| TRANSFORMERS | The transformers available when transforming | string | [node] | |
| TRANSFORMER_BASE_URL | The base http url the transformer is listening on | string | http://localhost | |
| START_PORT | The port to start hosting transformers on | number | 10000 | |
| MAX_IDLE_TIME_IN_SECONDS | The maximum time a transformer can be idle before being unloaded | number | 500 | |
| TRANSFORMER_DEPENDENCY_COMMAND | The command to run to install transformer dependencies | string | npm install --omit=dev --no-update-notifier --no-warnings --ignore-scripts | |
| TRANSFORMER_DEPENDENCY_FILE | The file to check for to determine if dependencies need to be installed | string | package.json | |
| TRANSFORMER_RUN_COMMAND | The command that is run when the transformer is started | string | ||
| TRANSFORMER_PORT_ENV_NAME | The transformer port environment variable name | string | PORT | |
| HOOK_PRE_LOAD | The command that is run before the transformer is loaded | string | ||
| HOOK_POST_LOAD | The command that is run after the transformer is loaded | string | ||
| HOOK_PRE_INSTALL | The command that is run before the transformer dependencies are installed | string | ||
| HOOK_POST_INSTALL | The command that is run after the transformer dependencies are installed | string | ||
| HOOK_PRE_START | The command that is run before the transformer is started | string | ||
| HOOK_POST_START | The command that is run after the transformer is started | string | ||
| HOOK_PRE_UNLOAD | The command that is run before the transformer is unloaded | string | ||
| HOOK_POST_UNLOAD | The command that is run after the transformer is unloaded | string |
To add a custom runtime to the transformer, extend from this container and customize the TRANSFORMERS, TRANSFORMER_DEPENDENCY_COMMAND, TRANSFORMER_RUN_COMMAND AND TRANSFORMER_DEPENDENCY_FILE environment variables.
FROM flowcoreio/adapter-nodejs-transformer-shell:1.9.0
USER root
# install python3
ENV PYTHONUNBUFFERED=1
RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python
RUN python3 -m ensurepip
RUN pip3 install --no-cache --upgrade pip setuptools
ENV HOOK_PRE_LOAD="python -m venv .venv"
ENV TRANSFORMER_DEPENDENCY_COMMAND="source .venv/bin/activate && pip install --isolated -r requirements.txt"
ENV TRANSFORMER_DEPENDENCY_FILE="requirements.txt"
ENV TRANSFORMER_RUN_COMMAND="source .venv/bin/activate && uvicorn {}:app"
ENV TRANSFORMERS="python"
ENV TRANSFORMER_PORT_ENV_NAME="UVICORN_PORT"
USER node
Content type
Image
Digest
sha256:0883a7111…
Size
91.7 MB
Last updated
over 1 year ago
docker pull flowcoreio/adapter-nodejs-transformer-shell