add docker support (#11)

This commit is contained in:
Hibuz 2021-03-01 03:51:36 +09:00 committed by GitHub
parent fe9543163d
commit 59eb2ffca7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM rust:1.50 as builder
RUN cargo install --git https://github.com/roapi/roapi --branch main --bin roapi-http
FROM debian:buster-slim
RUN apt-get update && apt-get install -y libssl-dev && rm -rf /var/lib/apt/lists/*
COPY test_data /test_data
COPY --from=builder /usr/local/cargo/bin/roapi-http /usr/local/bin/roapi-http
CMD ["roapi-http"]

View File

@ -32,6 +32,12 @@ See below for a high level diagram:
cargo install --git https://github.com/roapi/roapi --branch main --bin roapi-http
```
```bash
# docker build
docker build . -t roapi-http
```
## Usage
### Quick start
@ -45,6 +51,13 @@ roapi-http \
--table 'spacex_launches:test_data/spacex-launches.json'
```
```bash
# docker run
docker run --rm -t -p 8080:8080 roapi-http roapi-http --addr 0.0.0.0:8080 \
--table 'uk_cities:test_data/uk_cities_with_headers.csv' \
--table 'spacex_launches:test_data/spacex-launches.json'
```
Query tables using SQL, GraphQL or REST:
```bash