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 Dockerfile and docker-compose files #15

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Dockerfile
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"]
12 changes: 12 additions & 0 deletions docker-compose.yaml
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
Loading