Skip to content

Commit

Permalink
add docker and docker-compose files (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
cubny authored Feb 19, 2024
1 parent cb0f339 commit fac3dd6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
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

0 comments on commit fac3dd6

Please sign in to comment.