-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (23 loc) · 981 Bytes
/
Copy pathDockerfile
File metadata and controls
30 lines (23 loc) · 981 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
# syntax=docker/dockerfile:1
ARG GO_VERSION=1.25
FROM golang:${GO_VERSION}-alpine AS build
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/terrain-server ./cmd/terrain-server && \
CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/terrain-tool ./cmd/terrain-tool
FROM alpine:3.22
RUN apk add --no-cache ca-certificates && \
addgroup -S terrain && \
adduser -S -G terrain terrain
WORKDIR /app
COPY --from=build /out/terrain-server /usr/local/bin/terrain-server
COPY --from=build /out/terrain-tool /usr/local/bin/terrain-tool
COPY config/terrain-server.json config/s3-terrain.json ./config/
COPY examples/tile.json ./examples/tile.json
COPY data/terrain-index.bin ./data/terrain-index.bin
USER terrain
EXPOSE 8080
ENTRYPOINT ["terrain-server"]
CMD ["-config", "config/terrain-server.json", "-credentials", "config/credentials.env", "-addr", "0.0.0.0:8080"]