mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 00:23:03 +00:00
docs: explain how to work with the dockerfile
This commit is contained in:
20
README.md
20
README.md
@@ -9,29 +9,41 @@
|
||||
## How to get started
|
||||
|
||||
To install all needed `npm` packages:
|
||||
```sh
|
||||
```shell
|
||||
npm install
|
||||
```
|
||||
|
||||
To prepare the script to be executed, run:
|
||||
```sh
|
||||
```shell
|
||||
npm run build
|
||||
```
|
||||
|
||||
To execute the code in "CLI" script (basically to execute the connector):
|
||||
```sh
|
||||
```shell
|
||||
node lib/cli.js run <backendURL> <origin> <licensePlate>
|
||||
e.g.:
|
||||
node lib/cli.js run http://localhost:3000 minimal-connector f-u
|
||||
```
|
||||
|
||||
To run some sample tests, use:
|
||||
```sh
|
||||
```shell
|
||||
npm test
|
||||
```
|
||||
|
||||
The `npm` scripts are defined in `package.json` file.
|
||||
|
||||
After building the project once, the connector image can be build.
|
||||
```shell
|
||||
docker build .
|
||||
```
|
||||
|
||||
Use the following command to run the container of this connector. Assuming there is a local backend running.
|
||||
```shell
|
||||
docker run --network host <image-id> <backendURL> <origin> <licensePlate>
|
||||
e.g.:
|
||||
docker run --network host registry.gitlab.com/openstapps/minimal-connector http://localhost:3000 minimal-connector f-u
|
||||
```
|
||||
|
||||
## Creating your own connector
|
||||
|
||||
1. Update the `executeConnector`-function in `cli.ts` according to the comments and needs of your connector
|
||||
|
||||
Reference in New Issue
Block a user