From adfd1e9b8298456493b488c736436fad33ca31f2 Mon Sep 17 00:00:00 2001 From: ChrQR Date: Sat, 18 May 2024 00:27:27 +0200 Subject: [PATCH] Tried adding it as build args. In retrospect I believe I was doing it right before but was adding it at the wrong build stage. --- .gitea/workflows/pipeline.yaml | 4 ++-- Dockerfile | 11 ++--------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/pipeline.yaml b/.gitea/workflows/pipeline.yaml index e8e1bb5..c1b735b 100644 --- a/.gitea/workflows/pipeline.yaml +++ b/.gitea/workflows/pipeline.yaml @@ -34,5 +34,5 @@ jobs: context: . push: true tags: gitea.rannes.dev/rannes.dev/local-weather:latest - secrets: | - "places_api=${{ secrets.PLACES_API }}" + build-args: | + PLACES_API=${{ secrets.PLACES_API }} diff --git a/Dockerfile b/Dockerfile index 657c5ea..77fb1bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,10 @@ # syntax=docker/dockerfile:1.3 FROM node:18-alpine AS base - - FROM base AS deps RUN apk add --no-cache libc6-compat WORKDIR /app -# Debug: List files in current directory -RUN ls -la - COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./ RUN ls -la # List files after copying to confirm presence RUN \ @@ -36,11 +31,9 @@ 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 +ARG PLACES_API +ENV PLACES_API ${PLACES_API} RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs