Files
vboxstock/Dockerfile
T
mfwadejr 2a9d95d3d9
Publish container / publish (push) Successful in 24s
Show running build version in the UI so stale deploys are obvious
Bakes the git commit SHA into the image at build time (Dockerfile
GIT_SHA/BUILD_DATE build-args, set by the CI workflow) and surfaces it
as a small "vX.Y.Z · <sha>" tag on the sign-in screen and in the header
user-menu, sourced from the existing unauthenticated /api/health
endpoint (now also returns appVersion/buildSha/buildDate). Also adds
buildSha/buildDate to the admin diagnostics payload. This makes it
possible to tell at a glance whether a running container matches the
latest published image without digging through registry timestamps.
2026-09-21 22:42:53 +00:00

22 lines
880 B
Docker

FROM node:22-alpine
ARG GIT_SHA=dev
ARG BUILD_DATE
LABEL org.opencontainers.image.source="https://git.us2plus2.com/marvin/vboxstock"
LABEL org.opencontainers.image.revision="$GIT_SHA"
LABEL org.opencontainers.image.description="Self-contained vSeeBox inventory and sales tracker"
WORKDIR /app
COPY package.json server.mjs ./
COPY public ./public
COPY vboxstock-entrypoint.sh /usr/local/bin/vboxstock-entrypoint
RUN apk add --no-cache su-exec \
&& chmod +x /usr/local/bin/vboxstock-entrypoint \
&& mkdir -p /data
ENV PORT=3000 DATA_DIR=/data NODE_ENV=production PUID=99 PGID=100
ENV GIT_SHA=$GIT_SHA
ENV BUILD_DATE=$BUILD_DATE
EXPOSE 3000
VOLUME ["/data"]
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 CMD wget -q -O /dev/null http://127.0.0.1:3000/api/health || exit 1
ENTRYPOINT ["/usr/local/bin/vboxstock-entrypoint"]
CMD ["node", "server.mjs"]