mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-07 05:52:57 +00:00
feat: add minimal-connector to compose
This commit is contained in:
19
README.md
19
README.md
@@ -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
|
||||||
|
|||||||
@@ -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"]
|
||||||
|
|||||||
5
start.sh
5
start.sh
@@ -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 _
|
||||||
|
|||||||
10
systemd/minimal-connector.service
Normal file
10
systemd/minimal-connector.service
Normal 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
|
||||||
8
systemd/minimal-connector.timer
Normal file
8
systemd/minimal-connector.timer
Normal 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
|
||||||
Reference in New Issue
Block a user