-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (24 loc) · 1004 Bytes
/
Dockerfile
File metadata and controls
35 lines (24 loc) · 1004 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
# =============================================================================
# Synapse API — Multi-stage Dockerfile
# =============================================================================
# Stage 1: Build the Go binary
# Stage 2: Minimal runtime image
# =============================================================================
# -- Build stage --------------------------------------------------------------
FROM golang:1.24-alpine AS builder
RUN apk add --no-cache git
WORKDIR /src
# Cache dependency downloads.
COPY go.mod go.sum ./
RUN go mod download
# Copy source and build.
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o /synapse-api ./cmd/synapse-api
# -- Runtime stage ------------------------------------------------------------
FROM alpine:3.20
RUN apk add --no-cache ca-certificates
WORKDIR /app
COPY --from=builder /synapse-api /app/synapse-api
COPY config.docker.yaml /app/config.yaml
EXPOSE 8080
ENTRYPOINT ["/app/synapse-api", "-config", "/app/config.yaml"]