-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add docker and docker-compose files (#15)
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 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,19 @@ | ||
FROM golang:1.22.0-alpine as builder | ||
RUN apk --update add ca-certificates | ||
RUN cd .. | ||
RUN mkdir lite-reader | ||
WORKDIR lite-reader | ||
COPY . ./ | ||
ENV GO111MODULE=on | ||
RUN CGO_ENABLED=0 GOOS=linux go build -mod=vendor -a -installsuffix cgo -o lite-reader ./cmd/main.go | ||
|
||
FROM scratch | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
COPY --from=builder /go/lite-reader/public ./public | ||
COPY --from=builder /go/lite-reader/lite-reader . | ||
|
||
# Directory to store the data, which can be referenced as the mounting point. | ||
VOLUME /var/opt/lite-reader | ||
EXPOSE 3000 | ||
|
||
ENTRYPOINT ["./lite-reader"] |
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,12 @@ | ||
version: '3.7' | ||
services: | ||
lite-reader: | ||
build: | ||
context: . | ||
dockerfile: ./Dockerfile | ||
environment: | ||
DB_PATH: /var/opt/lite-reader/agg.db | ||
ports: | ||
- "8080:3000" | ||
volumes: | ||
- ./data:/var/opt/lite-reader |