From cf6bc4db6bed0a915849ee5f79f2d0e7aa244fe0 Mon Sep 17 00:00:00 2001 From: "Arnaud (Arhuman) ASSAD" Date: Sat, 9 Aug 2025 17:52:01 +0200 Subject: [PATCH] fix arg in dockerfiles --- Dockerfile.console | 4 +++- Dockerfile.minion | 4 +++- Dockerfile.nexus | 4 +++- docker-compose.yml | 6 ++++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Dockerfile.console b/Dockerfile.console index f6b1efc..9b16ce5 100644 --- a/Dockerfile.console +++ b/Dockerfile.console @@ -14,7 +14,6 @@ COPY internal/ internal/ # Copy test certificates COPY internal/certs/files/test internal/certs/files COPY protogen/ protogen/ -COPY .env.${MINEXUS_ENV} ./.env.${MINEXUS_ENV} # Build the console binary RUN CGO_ENABLED=0 GOOS=linux GOFLAGS="-ldflags=-s -ldflags=-w" go build -o console ./cmd/console/ @@ -39,6 +38,9 @@ RUN groupadd dop && \ RUN mkdir -p /app WORKDIR /app +ARG MINEXUS_ENV +COPY .env.${MINEXUS_ENV} ./.env.${MINEXUS_ENV} + # Copy the binary from builder COPY --from=builder /app/console /app/console diff --git a/Dockerfile.minion b/Dockerfile.minion index b4bf96a..3ce6020 100644 --- a/Dockerfile.minion +++ b/Dockerfile.minion @@ -14,7 +14,6 @@ COPY internal/ internal/ # Copy test certificates COPY internal/certs/files/test internal/certs/files COPY protogen/ protogen/ -COPY .env.${MINEXUS_ENV} ./.env.${MINEXUS_ENV} # Build the minion binary RUN CGO_ENABLED=0 GOOS=linux GOFLAGS="-ldflags=-s -ldflags=-w" go build -o minion ./cmd/minion/ @@ -38,6 +37,9 @@ RUN groupadd dop && \ RUN mkdir -p /app WORKDIR /app +ARG MINEXUS_ENV +COPY .env.${MINEXUS_ENV} ./.env.${MINEXUS_ENV} + # Copy the binary from builder COPY --from=builder /app/minion /app/minion diff --git a/Dockerfile.nexus b/Dockerfile.nexus index 4030e03..73f1860 100644 --- a/Dockerfile.nexus +++ b/Dockerfile.nexus @@ -14,7 +14,6 @@ COPY internal/ internal/ # Copy test certificates COPY internal/certs/files/test internal/certs/files COPY protogen/ protogen/ -COPY .env.${MINEXUS_ENV} ./.env.${MINEXUS_ENV} # Build the nexus binary RUN CGO_ENABLED=0 GOOS=linux GOFLAGS="-ldflags=-s -ldflags=-w" go build -o nexus ./cmd/nexus/ @@ -39,6 +38,9 @@ RUN groupadd dop && \ RUN mkdir -p /app WORKDIR /app +ARG MINEXUS_ENV +COPY .env.${MINEXUS_ENV} ./.env.${MINEXUS_ENV} + # Copy the binary from builder COPY --from=builder /app/nexus /app/nexus diff --git a/docker-compose.yml b/docker-compose.yml index f20a922..6e15093 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,6 +28,8 @@ services: build: context: . dockerfile: Dockerfile.nexus + args: + MINEXUS_ENV: ${MINEXUS_ENV:-test} container_name: nexus_server env_file: - .env.${MINEXUS_ENV:-test} @@ -64,6 +66,8 @@ services: build: context: . dockerfile: Dockerfile.minion + args: + MINEXUS_ENV: ${MINEXUS_ENV:-test} container_name: minion env_file: - .env.${MINEXUS_ENV:-test} @@ -89,6 +93,8 @@ services: build: context: . dockerfile: Dockerfile.console + args: + MINEXUS_ENV: ${MINEXUS_ENV:-test} container_name: minexus_console env_file: - .env.${MINEXUS_ENV:-test}