-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile.integration
More file actions
47 lines (32 loc) · 1017 Bytes
/
Dockerfile.integration
File metadata and controls
47 lines (32 loc) · 1017 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
38
39
40
41
42
43
44
45
46
47
FROM golang:1.26.0-alpine AS builder
# Install build dependencies
RUN apk add --no-cache git ca-certificates tzdata
# Set working directory
WORKDIR /app
# Copy go mod files
COPY go.mod go.sum ./
# Copy source code
COPY . .
# Download dependencies and tidy
RUN go mod download && go mod tidy
# Build for integration testing (linux-amd64)
RUN GOOS=linux GOARCH=amd64 go build -mod=mod -o bin/solana-validator-ha ./cmd/solana-validator-ha
# Final stage
FROM alpine:latest
# Install runtime dependencies
RUN apk add --no-cache ca-certificates tzdata curl
# Create app user
RUN addgroup -g 1001 -S appgroup && \
adduser -u 1001 -S appuser -G appgroup
# Set working directory
WORKDIR /app
# Copy binary from builder
COPY --from=builder /app/bin/solana-validator-ha ./bin/solana-validator-ha
# Change ownership to app user
RUN chown -R appuser:appgroup /app
# Switch to app user
USER appuser
# Expose metrics port
EXPOSE 9090
# Default command (can be overridden)
CMD ["./bin/solana-validator-ha", "run"]