Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
205 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM golang:alpine AS builder | ||
RUN apk add --no-cache build-base | ||
WORKDIR /build | ||
COPY . . | ||
RUN apk --no-cache add ca-certificates | ||
RUN go build -ldflags="-s -w" -trimpath -o /dist/readability . | ||
RUN ldd /dist/readability | tr -s [:blank:] '\n' | grep ^/ | xargs -I % install -D % /dist/% | ||
RUN ln -s ld-musl-x86_64.so.1 /dist/lib/libc.musl-x86_64.so.1 | ||
|
||
FROM scratch | ||
COPY --from=builder /dist / | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
|
||
EXPOSE 8080 | ||
|
||
CMD ["/readability"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
# Readability | ||
|
||
Can find more at my blog [Write a Readability Tool](https://abcdlsj.github.io/posts/write-a-readability-tool.html) | ||
Can find more at my blog [Write a Readability Tool](https://abcdlsj.github.io/posts/write-a-readability-tool.html) | ||
|
||
|
||
## Run | ||
|
||
1. Stand run | ||
|
||
`PORT` default 8080 | ||
``` | ||
PORT=<port> REDIS_URL=redis://<address:port> go run main.go | ||
``` | ||
|
||
2. Use Docker | ||
|
||
See dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters