Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API server. #75

Closed
wants to merge 6 commits into from
Closed

Add API server. #75

wants to merge 6 commits into from

Conversation

bfabio
Copy link
Contributor

@bfabio bfabio commented Mar 9, 2020

Add a simple API server exposing the JSON data via HTTP.

The Dockerfile builds a small (~8MiB) stateless image (based on the data at dati-json/) which can be easily scaled up, fe. with Kubernetes replicas.

From DockerHub:
$ docker run -p8000:8000 bfabio/covid-19

Edit:
Temporarly available at https://covid-19.zland.org/

fe. https://covid-19.zland.org/regioni/Lombardia

API documentation

@apiraino
Copy link

@bfabio if after the build you also add

RUN cd api && strip ./target/x86_64-unknown-linux-musl/release/api

the docker image size is halved 😄

@bfabio
Copy link
Contributor Author

bfabio commented Mar 10, 2020

@apiraino Good call

README.md Show resolved Hide resolved
Copy link

@brucellino brucellino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can only suggest the minor change of keeping the Dockerfile in a sub-directory.

@macchie
Copy link

macchie commented Mar 11, 2020

Well done. I was about to implement the same API Project on Loopback but you arrived first.

Thanks!

@bfabio bfabio force-pushed the api branch 2 times, most recently from a73c457 to 49affd3 Compare March 12, 2020 17:51
@bfabio
Copy link
Contributor Author

bfabio commented Mar 13, 2020

I can only suggest the minor change of keeping the Dockerfile in a sub-directory.

I think having it in the root directory it's useful: you notice straight away there's a Docker image you can build.

@bfabio bfabio force-pushed the api branch 2 times, most recently from a35e291 to 4e93fda Compare March 14, 2020 17:23
@umbros
Copy link
Contributor

umbros commented Mar 14, 2020

Ciao @bfabio sto testando una soluzione basata su lambda. Grazie per la collaborazione, puoi comunque pubblicare il docker su un tuo repo e fare riferimento a questo per i dati

@umbros umbros closed this Mar 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants