feat: add minimal-connector to compose

This commit is contained in:
Michel Jonathan Schmitz
2019-07-25 09:55:21 +02:00
parent 23f4f2de2f
commit 203a8127f5
5 changed files with 46 additions and 0 deletions

View File

@@ -106,6 +106,25 @@ This is a small program that shows the usage of the [api](https://gitlab.com/ope
data from TypeScript code. Feel free to copy the [minimal-connector](https://gitlab.com/openstapps/minimal-connector/) data from TypeScript code. Feel free to copy the [minimal-connector](https://gitlab.com/openstapps/minimal-connector/)
and write your own connector with it. and write your own connector with it.
## Add your connector
You may want to integrate your connectors in the `docker-compose.yml` to
deploy your whole StApps-backend-environment in a single command. Use the
`systemd` directory in this project as an example of how to deploy
your connector(s) and configure `systemd` services and timers.
The service will try to restart a named container. That means for successful
execution the container needs to be started once before with the appropriate
command.
```shell
docker-compose up minimal-connector
```
To enable the service that runs the connector periodically execute:
```shell
systemctl --now enable /absolute/path/minimal-deployment/minimal-connector/minimal-connector.service /absolute/path/minimal-deployment/minimal-connector/minimal-connector.timer
```
This command will immediately start the service on execution.
## Round off your deployment with the [proxy](https://gitlab.com/openstapps/proxy) ## Round off your deployment with the [proxy](https://gitlab.com/openstapps/proxy)
The backend is exposed on the port 3000 now. This means anyone can import data into your backend and you can only run The backend is exposed on the port 3000 now. This means anyone can import data into your backend and you can only run
one version of the backend at a time. Have a look at the [proxy](https://gitlab.com/openstapps/proxy/) to secure and one version of the backend at a time. Have a look at the [proxy](https://gitlab.com/openstapps/proxy/) to secure and

View File

@@ -32,3 +32,7 @@ services:
links: links:
- "backend" - "backend"
minimal-connector:
image: registry.gitlab.com/openstapps/minimal-connector:core-0.23
container_name: minimal-connector-0.23
command: ["http://backend:3000", "minimal-connector", "f-u"]

View File

@@ -52,6 +52,11 @@ Useful commands:
* In case you don't need the containers to be running anymore, you can also stop them using docker-compose command (example for database container): * In case you don't need the containers to be running anymore, you can also stop them using docker-compose command (example for database container):
$SUDO docker-compose stop database $SUDO docker-compose stop database
* If you want to test the functionality of the "minimal-connector", use the following command.
$SUDO docker-compose up minimal-connector
EOF EOF
read _ read _

View File

@@ -0,0 +1,10 @@
[Unit]
Description=Restarts the "minimal-connector-0.23" container
[Service]
Type=oneshot
User=root
ExecStart=/usr/bin/env docker restart minimal-connector-0.23
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,8 @@
[Unit]
Description=Run the minimal-connector.service every 5 minutes. If you need other timer configurations, please refer to: https://wiki.archlinux.org/index.php/Systemd/Timers
[Timer]
OnCalendar=*:0/5
[Install]
WantedBy=timers.target