32 lines
855 B
Docker
32 lines
855 B
Docker
|
|
# ── Build stage ──────────────────────────────────────────
|
||
|
|
FROM golang:1.23-alpine AS builder
|
||
|
|
|
||
|
|
WORKDIR /build
|
||
|
|
|
||
|
|
RUN apk add --no-cache git ca-certificates tzdata
|
||
|
|
|
||
|
|
COPY go.mod go.sum ./
|
||
|
|
RUN go mod download
|
||
|
|
|
||
|
|
COPY . .
|
||
|
|
|
||
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
|
||
|
|
go build -ldflags="-w -s" -o floorvisualizer .
|
||
|
|
|
||
|
|
# ── Run stage ────────────────────────────────────────────
|
||
|
|
FROM alpine:3.20
|
||
|
|
|
||
|
|
WORKDIR /app
|
||
|
|
|
||
|
|
RUN apk add --no-cache ca-certificates tzdata
|
||
|
|
|
||
|
|
COPY --from=builder /build/floorvisualizer .
|
||
|
|
COPY --from=builder /build/data ./data
|
||
|
|
COPY --from=builder /build/knowledge_images ./knowledge_images
|
||
|
|
|
||
|
|
RUN mkdir -p outputs uploads static
|
||
|
|
|
||
|
|
EXPOSE 8099
|
||
|
|
|
||
|
|
CMD ["./floorvisualizer"]
|