-
Notifications
You must be signed in to change notification settings - Fork 102
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (21 loc) · 858 Bytes
/
Dockerfile
File metadata and controls
28 lines (21 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Build the Go binary in a separate stage utilizing Makefile.
# Aligned with LocalAGI / LocalAI (both on Go 1.26). LocalRecall's go.mod
# directive is 1.25.0; the previous golang:1.24 base started failing
# `go mod download` after the go-pdfium swap brought in newer x/* deps.
FROM golang:1.26 AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN make build
# Use the official Ubuntu 22.04 image as a base for the final image
FROM scratch AS base
# Install ca-certificates to ensure TLS verification works
#RUN apt-get update && apt-get install -y ca-certificates && update-ca-certificates
COPY --from=builder /app/localrecall /localrecall
COPY --from=builder /etc/ssl /etc/ssl
COPY --from=builder /tmp /tmp
# Expose necessary ports
EXPOSE 8080
# Set default command to start the Go application
ENTRYPOINT [ "/localrecall" ]