18 lines
498 B
Docker
18 lines
498 B
Docker
FROM golang:alpine as builder
|
|
|
|
# build app
|
|
WORKDIR /opt/torrentchecker/src
|
|
COPY . /opt/torrentchecker/src
|
|
|
|
RUN go build -o /opt/torrentchecker/torrentchecker main.go
|
|
RUN chmod a+x /opt/torrentchecker/torrentchecker
|
|
|
|
# target image
|
|
FROM golang:alpine
|
|
RUN mkdir -p /opt/torrentchecker
|
|
|
|
COPY --from=builder /opt/torrentchecker/torrentchecker /opt/torrentchecker/torrentchecker
|
|
RUN crontab -l | { cat; echo "* * * * * /opt/torrentchecker/torrentchecker"; } | crontab -
|
|
|
|
|
|
CMD ["crond", "-f", "-l", "2"]
|