From f5ce2dbc7186705a2e8097a52be55a559d80c61a Mon Sep 17 00:00:00 2001 From: ChrQR Date: Sat, 18 May 2024 00:20:15 +0200 Subject: [PATCH] Moved mounting env variables. --- Dockerfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0312c41..657c5ea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,12 @@ # syntax=docker/dockerfile:1.3 FROM node:18-alpine AS base + + FROM base AS deps RUN apk add --no-cache libc6-compat WORKDIR /app -# Mount environment variables -RUN --mount=type=secret,id=places_api \ - cat /run/secrets/places_api - # Debug: List files in current directory RUN ls -la @@ -38,6 +36,10 @@ RUN \ FROM base AS runner WORKDIR /app +# Mount environment variables +RUN --mount=type=secret,id=places_api \ + cat /run/secrets/places_api + ENV NODE_ENV production RUN addgroup --system --gid 1001 nodejs