-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (23 loc) · 725 Bytes
/
Copy pathDockerfile
File metadata and controls
35 lines (23 loc) · 725 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
29
30
31
32
33
34
35
# syntax=docker/dockerfile:1.7
# Build aiproxy binary
FROM golang:1.25-alpine AS builder
RUN apk add --no-cache git ca-certificates
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux \
go build -trimpath -ldflags '-s -w' -o /out/aiproxy ./cmd/aiproxy
# Build aiproxy container
FROM alpine:latest
RUN apk add --no-cache ca-certificates tzdata \
&& addgroup -S aiproxy \
&& adduser -S -G aiproxy -H -D aiproxy \
&& mkdir -p /etc/aiproxy \
&& chown -R aiproxy:aiproxy /etc/aiproxy
COPY --from=builder /out/aiproxy /usr/local/bin/aiproxy
USER aiproxy
WORKDIR /etc/aiproxy
EXPOSE 8080
ENTRYPOINT ["/usr/local/bin/aiproxy"]
CMD ["--config", "/etc/aiproxy/config.yaml"]