breadcrumb/Dockerfile
Astra c41a2c5411 Initial commit: Breadcrumb GPS trip viewer
Go server receiving Colota location data into SQLite, with a trip-segmentation
API and embedded web frontend for browsing trips on a map.
2026-06-03 19:34:08 +01:00

26 lines
719 B
Docker

FROM golang:1.22-alpine AS builder
# gcc is required for go-sqlite3 (CGO)
RUN apk add --no-cache gcc musl-dev
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=1 GOOS=linux go build -o breadcrumb .
# ── Runtime image ─────────────────────────────────────────────────────────────
FROM alpine:3.19
RUN apk add --no-cache ca-certificates
WORKDIR /app
COPY --from=builder /app/breadcrumb .
# Data directory for the SQLite file (mount a volume here)
RUN mkdir -p /data
EXPOSE 8080
ENTRYPOINT ["./breadcrumb"]
CMD ["-port", "8080", "-db", "/data/locations.db"]