diff --git a/etc/dockerfile b/etc/dockerfile index 68782a8..ff56220 100644 --- a/etc/dockerfile +++ b/etc/dockerfile @@ -1,12 +1,13 @@ FROM golang:1.21.5-alpine AS build -RUN apk add --no-cache build-base git - +RUN apk add build-base git WORKDIR /src -RUN git clone https://github.com/nkanaev/yarr.git . +COPY . . ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE" -RUN make build_default +RUN make build_linux -FROM alpine:3.19 -COPY --from=build /src/_output/yarr /usr/local/bin/yarr -RUN mkdir /data -CMD ["/usr/local/bin/yarr", "-addr", "0.0.0.0:7070", "-db", "/data/yarr.db"] \ No newline at end of file +FROM alpine:latest +RUN apk add --no-cache ca-certificates && \ + update-ca-certificates +COPY --from=build /src/_output/linux/yarr /usr/local/bin/yarr +EXPOSE 7070 +CMD ["/usr/local/bin/yarr", "-addr", "0.0.0.0:7070", "-db", "/data/yarr.db"] diff --git a/go.mod b/go.mod index 811c627..cedf630 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/nkanaev/yarr go 1.17 require ( - github.com/mattn/go-sqlite3 v1.14.16 + github.com/mattn/go-sqlite3 v1.14.7 golang.org/x/net v0.17.0 golang.org/x/sys v0.13.0 )