diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5f262d0 --- /dev/null +++ b/Dockerfile @@ -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"] \ No newline at end of file diff --git a/README.md b/README.md index 3a56959..1de09d9 100644 --- a/README.md +++ b/README.md @@ -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