build: add docker build setup

This commit is contained in:
Alexander Navarro 2024-12-20 16:16:15 -03:00
parent b0506c3eab
commit 66b21dabcd
6 changed files with 84 additions and 20 deletions

26
Dockerfile Normal file
View file

@ -0,0 +1,26 @@
FROM golang:1.23-alpine AS builder
WORKDIR /usr/src/app
# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
COPY go.mod go.sum ./
RUN go mod download && go mod verify
COPY . .
RUN go build -v ./main.go
FROM alpine
COPY --from=builder /usr/src/app/main /usr/bin/miniflux-archiver
ENV MFA_CRON="* * * * *"
WORKDIR /app
COPY ./entrypoint.sh .
ENTRYPOINT ["./entrypoint.sh"]
RUN chmod +x entrypoint.sh /usr/bin/miniflux-archiver
CMD ["--help"]