-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (26 loc) · 820 Bytes
/
Copy pathDockerfile
File metadata and controls
40 lines (26 loc) · 820 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
## Multi-stage Dockerfile for MapToPoster Go API
FROM golang:1.24-alpine AS builder
WORKDIR /app
# Install build tools (if CGO-enabled deps are ever needed)
RUN apk add --no-cache git
# Pre-download modules
COPY go.mod go.sum ./
RUN go mod download
# Copy source
COPY . .
# Build a static binary for Linux
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /app/bin/maptoposter ./cmd
# Minimal runtime image
FROM alpine:3.20
RUN apk add --no-cache ca-certificates
WORKDIR /app
# Copy binary
COPY --from=builder /app/bin/maptoposter /app/bin/maptoposter
# Copy runtime data needed by the app
COPY themes/ themes/
COPY internal/geocoder/cities.json internal/geocoder/cities.json
COPY internal/poster/fonts internal/poster/fonts
COPY docs docs
ENV PORT=8080
EXPOSE 8080
ENTRYPOINT ["/app/bin/maptoposter"]