Changeset 0.23.1 (#154)
This commit is contained in:
@@ -19,7 +19,12 @@ RUN go mod download
|
||||
# Copy source and tidy (resolves any go.sum gaps)
|
||||
COPY server/ .
|
||||
RUN go mod tidy
|
||||
RUN CGO_ENABLED=0 go build -ldflags="-s -w -X main.Version=${APP_VERSION}" -o /bin/switchboard .
|
||||
|
||||
# Copy VERSION from repo root — used by ldflags and copied to runtime image.
|
||||
# If APP_VERSION build-arg was supplied by CI, it takes precedence via ldflags.
|
||||
# If not, $(cat VERSION) reads the file directly so the binary always has a real version.
|
||||
COPY VERSION ./
|
||||
RUN CGO_ENABLED=0 go build -ldflags="-s -w -X main.Version=$(cat VERSION)" -o /bin/switchboard .
|
||||
|
||||
# Runtime stage
|
||||
FROM debian:bookworm-slim
|
||||
@@ -31,6 +36,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
COPY --from=builder /bin/switchboard /usr/local/bin/switchboard
|
||||
COPY --from=builder /app/database/migrations /app/database/migrations
|
||||
|
||||
# VERSION file at /VERSION — version.go init() reads it as fallback for local/dev runs
|
||||
COPY --from=builder /app/VERSION /VERSION
|
||||
|
||||
# Builtin extensions (seeded into DB on startup)
|
||||
COPY extensions/builtin/ /app/extensions/builtin/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user