mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-02 20:30:10 +00:00
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:
+4
-4
@@ -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 && \
|
||||
|
||||
Reference in New Issue
Block a user