2023-08-07 17:05:12 +00:00
|
|
|
FROM golang:alpine as builder
|
2020-05-09 20:44:28 +00:00
|
|
|
|
2023-08-07 17:05:12 +00:00
|
|
|
WORKDIR /go/src/git.dragse.it/fenpaws/e621-to-neo4j
|
|
|
|
|
|
|
|
RUN apk add -U --no-cache ca-certificates && update-ca-certificates
|
|
|
|
|
|
|
|
COPY go.mod go.sum ./
|
2020-08-09 08:07:16 +00:00
|
|
|
RUN go mod download
|
|
|
|
|
2023-08-07 17:05:12 +00:00
|
|
|
COPY . ./
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -ldflags "-w -s" -o /app
|
2020-08-09 08:07:16 +00:00
|
|
|
|
2020-05-09 20:44:28 +00:00
|
|
|
|
2023-08-07 17:05:12 +00:00
|
|
|
FROM scratch
|
2020-04-11 21:27:24 +00:00
|
|
|
|
2023-08-07 17:05:12 +00:00
|
|
|
WORKDIR /
|
2020-04-11 21:27:24 +00:00
|
|
|
|
2023-08-07 17:05:12 +00:00
|
|
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
|
|
|
COPY --from=builder /app ./
|
2020-04-11 21:27:24 +00:00
|
|
|
|
2023-08-07 17:05:12 +00:00
|
|
|
EXPOSE 8080
|
|
|
|
CMD ["/app"]
|