-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (26 loc) · 719 Bytes
/
Copy pathDockerfile
File metadata and controls
37 lines (26 loc) · 719 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
36
37
# Build stage
FROM golang:1.24-alpine AS builder
WORKDIR /app
# Copy go mod files
COPY go.mod go.sum ./
# Download dependencies
RUN go mod download
# Copy source code (excluding scripts folder)
COPY cmd/ ./cmd/
COPY internal/ ./internal/
COPY config.yaml .
COPY filtering_rules.yaml .
# Build the application
RUN CGO_ENABLED=0 go build -a -installsuffix cgo -o influxdb-proxy cmd/proxy/main.go
# Final stage
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /app
# Copy binary from builder stage
COPY --from=builder /app/influxdb-proxy .
COPY --from=builder /app/config.yaml .
COPY --from=builder /app/filtering_rules.yaml .
# Expose port
EXPOSE 8087
# Run the proxy
CMD ["./influxdb-proxy"]