1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-21 17:56:53 +02:00

add roapi

This commit is contained in:
kev 2024-07-19 14:42:18 +08:00
parent 5540773d96
commit 89e53ad1be
5 changed files with 15654 additions and 0 deletions

View File

@ -486,6 +486,7 @@ A collection of delicious docker recipes.
- [x] node-chrome
- [x] node-firefox
- [x] standalone-firefox
- [x] ghcr.io/roapi/roapi
- [x] aerokube
- [x] selenoid
- [x] video-recorder

39
roapi/README.md Normal file
View File

@ -0,0 +1,39 @@
roapi
=====
[ROAPI][1] automatically spins up read-only APIs for static datasets without
requiring you to write a single line of code.
```bash
$ mkdir -p data
$ curl https://api.spacexdata.com/v4/launches | jq . > data/spacex_launches.json
$ docker compose up -d
```
```bash
$ psql -h 127.0.0.1 -p 5432
kev=> select id, name from spacex_launches limit 10;
id | name
--------------------------+----------------------
5eb87cd9ffd86e000604b32a | FalconSat
5eb87cdaffd86e000604b32b | DemoSat
5eb87cdbffd86e000604b32c | Trailblazer
5eb87cdbffd86e000604b32d | RatSat
5eb87cdcffd86e000604b32e | RazakSat
5eb87cddffd86e000604b32f | Falcon 9 Test Flight
5eb87cdeffd86e000604b330 | COTS 1
5eb87cdfffd86e000604b331 | COTS 2
5eb87ce0ffd86e000604b332 | CRS-1
5eb87ce1ffd86e000604b333 | CRS-2
(10 rows)
kev=> \q
```
```bash
$ curl 127.0.0.1:8080/api/sql -d "SELECT id, name FROM spacex_launches LIMIT 10" | jq -r '.[]|[.id,.name]|@tsv'
$ curl 127.0.0.1:8080/api/kv/spacex_launch_name/600f9a8d8f798e2a4d5f979e
```
[1]: https://github.com/roapi/roapi

15
roapi/data/roapi.yml Normal file
View File

@ -0,0 +1,15 @@
addr:
http: 0.0.0.0:8080
postgres: 0.0.0.0:5432
tables:
- name: "spacex_launches"
uri: "https://api.spacexdata.com/v4/launches"
option:
format: "json"
kvstores:
- name: "spacex_launch_name"
uri: "./spacex_launches.json"
key: id
value: name

File diff suppressed because it is too large Load Diff

11
roapi/docker-compose.yml Normal file
View File

@ -0,0 +1,11 @@
version: "3.8"
services:
roapi:
image: ghcr.io/roapi/roapi:v0.11.3
command: -c roapi.yml
ports:
- "8080:8080"
volumes:
- ./data:/etc/roapi
working_dir: /etc/roapi
restart: unless-stopped