Skip to content
This repository has been archived by the owner on Sep 20, 2020. It is now read-only.

Commit

Permalink
Draft readme
Browse files Browse the repository at this point in the history
  • Loading branch information
杜興怡 committed Feb 2, 2019
1 parent 85f2064 commit ea75f8f
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Dockerfile.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM golang:alpine3.8 AS builder
ARG ZIPPROTOC=https://github.com/protocolbuffers/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip
ENV PATH=/usr/local/protoc/bin:$PATH
RUN apk update && apk --no-cache add openssl-dev autoconf automake libtool git \
build-base gcc abuild binutils cmake linux-headers \
unzip curl ; \
go get -u google.golang.org/grpc ; \
go get -u github.com/golang/protobuf/protoc-gen-go ; \
curl -o protoc.zip -L $ZIPPROTOC ; \
unzip protoc.zip -d /usr/local/protoc ;
WORKDIR /app
RUN git clone -b heroku https://github.com/patterns/fhirbuffer ; \
cd fhirbuffer ; \
go install ./cmd/...

# final stage
FROM alpine:3.8
####ENV DATABASE_URL="postgres://postgres:postgres@localhost:5432/fhirbase"
ENV FHIRBUFFER_COMMON=fhirbuffer3
COPY --from=builder /go/bin/server /bin/fhirbuffer
RUN adduser -D fhirbuffer ;
USER fhirbuffer
CMD ["/bin/fhirbuffer"]


40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# fhirbuffer

fhirbuffer is a gRPC service to export data from [Fhirbase](https://health-samurai.io/fhirbase).
The one thing we want it to do well is talk gRPC.
So a downstream process isn't aware of the database, SQL, and ultimately even Go.

For a prototype of the end-to-end flow, see [fhirping app hosted on Glitch](https://accidental-oil.glitch.me).
Read the [summary blog post](https://patterns.github.io/tfx).
![diagram](diagram/diagram.svg)

## Quickstart

1. Install Fhirbase (see their [Get Started](https://health-samurai.io/fhirbase) steps)
2. Git clone repo
3. Docker build

```
git clone https://github.com/patterns/fhirbuffer
docker build -f fhirbuffer/Dockerfile.template -t fhirbuffer fhirbuffer
docker run -ti --rm -e DATABASE_URL="postgres://postgres:postgres@localhost:5432/fhirbase" fhirbuffer
```


## Credits

Health Samurai's
[Fhirbase](https://github.com/fhirbase/fhirbase)
[(LICENSE)](https://github.com/fhirbase/fhirbase/blob/master/MIT-LICENSE)

gRPC
[Basics for Go](https://grpc.io/docs/tutorials/basic/go.html)

Jack Christensen's
[PGX](https://github.com/jackc/pgx)
[(LICENSE)](https://github.com/jackc/pgx/blob/master/LICENSE)

Johan Brandhorst's
[gRPC Client Authentication](https://jbrandhorst.com/post/grpc-auth/)
[(LICENSE)](https://github.com/johanbrandhorst/grpc-auth-example/blob/master/LICENSE)

2 changes: 2 additions & 0 deletions diagram/diagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ea75f8f

Please sign in to comment.