login
This commit is contained in:
16
Dockerfile
16
Dockerfile
@@ -4,7 +4,21 @@ FROM golang:1.24 AS builder
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -o server
|
||||
# Which commit this image is. Reported by GET /live/api/v1/health, so "I pushed
|
||||
# it" and "it is running" stop being the same sentence — a redeploy can reuse a
|
||||
# cached image, and there was no way to tell from outside.
|
||||
#
|
||||
# Passed by the platform as a build argument:
|
||||
# docker build --build-arg BUILD_VERSION=$(git rev-parse --short HEAD) .
|
||||
# In Dokploy this goes under the application's Build settings. Left unset it
|
||||
# reads "unknown", which is itself worth seeing — it means nothing stamped it.
|
||||
#
|
||||
# `.git` is not in the build context (see .dockerignore), so the build cannot
|
||||
# work this out for itself.
|
||||
ARG BUILD_VERSION=unknown
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build \
|
||||
-ldflags "-X nearle/controllers.Version=${BUILD_VERSION}" -o server
|
||||
|
||||
# ---------- Runtime Stage ----------
|
||||
FROM alpine:latest
|
||||
|
||||
Reference in New Issue
Block a user