diff --git a/ui/Dockerfile b/ui/Dockerfile index 13ae8d089..7c1c1179f 100644 --- a/ui/Dockerfile +++ b/ui/Dockerfile @@ -7,6 +7,11 @@ RUN npx parcel build src/index.html FROM nginx:alpine +ARG version=dev +ARG commit=HEAD +ENV VERSION=${version} +ENV HEAD=${commit} + ENV API_PORT=9003 ENV API_SERVER=0.0.0.0 ENV UI_PORT=9090 diff --git a/ui/Dockerfile.cross b/ui/Dockerfile.cross index cee9fafac..3a67093f4 100644 --- a/ui/Dockerfile.cross +++ b/ui/Dockerfile.cross @@ -1,5 +1,10 @@ FROM nginx:alpine +ARG version=dev +ARG commit=HEAD +ENV VERSION=${version} +ENV HEAD=${commit} + ENV API_PORT=9003 ENV API_SERVER=0.0.0.0 ENV UI_PORT=9090 diff --git a/ui/docker-entrypoint.sh b/ui/docker-entrypoint.sh index a73e8c8c2..6eb4ecc60 100755 --- a/ui/docker-entrypoint.sh +++ b/ui/docker-entrypoint.sh @@ -11,5 +11,7 @@ fi envsubst '$API_PORT $API_SERVER $UI_PORT' < /etc/nginx/conf.d/default.nginx.conf.template > /etc/nginx/conf.d/default.nginx.conf +echo "Starting ui version $VERSION ($HEAD)" + # Run the parent (nginx) container's entrypoint script exec /docker-entrypoint.sh "$@" diff --git a/ui/justfile b/ui/justfile index db05e1cba..1237c4066 100644 --- a/ui/justfile +++ b/ui/justfile @@ -1,3 +1,6 @@ +version := `../tools/image-tag` +commit := `git rev-parse --short HEAD` + default: just --list @@ -13,6 +16,8 @@ build IMAGETAG: build-local -f 'Dockerfile.cross' \ --provenance=false \ -t {{IMAGETAG}}-amd64 \ + --build-arg version={{version}} \ + --build-arg commit={{commit}} \ --push \ . @@ -22,6 +27,8 @@ build IMAGETAG: build-local -f 'Dockerfile.cross' \ --provenance=false \ -t {{IMAGETAG}}-arm64 \ + --build-arg version={{version}} \ + --build-arg commit={{commit}} \ --push \ .