generated from alecodes/base-template
build: add docker build setup
This commit is contained in:
parent
b0506c3eab
commit
66b21dabcd
6 changed files with 84 additions and 20 deletions
26
Dockerfile
Normal file
26
Dockerfile
Normal 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"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue