aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
blob: 7ebc33a75076d5e45a96ed36f159d76c3e3636c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
FROM golang:1.19 as builder

RUN mkdir /build
ADD . /build/
WORKDIR /build
# Go 1.18 introduced a compile-time dependency for Git unless `-buildvcs=false` is provided
RUN CGO_ENABLED=1 GOOS=linux go build -a -buildvcs=false -installsuffix cgo -ldflags '-extldflags "-static" -s -w' -o main github.com/codemicro/walrss/walrss

FROM alpine
COPY --from=builder /build/main /
WORKDIR /run

ENV WALRSS_DIR /run
CMD ["../main"]