-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (23 loc) · 740 Bytes
/
Dockerfile
File metadata and controls
36 lines (23 loc) · 740 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
# Stage 1: Build the Go binary
FROM golang:1.23 AS builder
# Create a directory for the application
WORKDIR /app
# Fetch dependencies
COPY go.mod go.sum ./
RUN go mod download
COPY pkg ./pkg
COPY cmd/jetstream ./cmd/jetstream
COPY Makefile ./
# Build the application
RUN make build
# Stage 2: Import SSL certificates
FROM alpine:latest as certs
RUN apk --update add ca-certificates
# Stage 3: Build a minimal Docker image
FROM debian:stable-slim
# Import the SSL certificates from the first stage.
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
# Copy the binary from the first stage.
COPY --from=builder /app/jetstream .
# Set the startup command to run the binary
CMD ["./jetstream"]