Move ARG declarations after FROM in Dockerfile

Re-declared build arguments GIT_COMMIT and BUILD_DATE after the FROM instruction to ensure they are available in subsequent build stages, as ARGs before FROM are not accessible after the base image is set.
This commit is contained in:
kikootwo
2026-01-09 20:12:42 -05:00
parent 384601014a
commit ba5f5cf7d6
+4 -4
View File
@@ -2,13 +2,13 @@
# Single container with PostgreSQL, Redis, and Next.js app
# Designed for easy deployment with minimal configuration
# Build arguments for version info
ARG GIT_COMMIT=unknown
ARG BUILD_DATE=unknown
# Start from debian base with node preinstalled
FROM node:20-bookworm AS base
# Re-declare build arguments after FROM (ARGs before FROM are not available after)
ARG GIT_COMMIT=unknown
ARG BUILD_DATE=unknown
# Install PostgreSQL 16 repository key
RUN apt-get update && apt-get install -y curl gnupg && \
install -d /etc/apt/keyrings && \