Skip to content

Commit 65df0dd

Browse files
authored
Merge pull request #52 from CarboxyDev/development
Fix web dockerfile missing env var
2 parents a167dfb + 98aea31 commit 65df0dd

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

.github/workflows/cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,6 @@ jobs:
104104
tags: ${{ steps.meta.outputs.tags }}
105105
labels: ${{ steps.meta.outputs.labels }}
106106
build-args: |
107-
NEXT_PUBLIC_API_URL=${{ vars.NEXT_PUBLIC_API_URL }}
107+
NEXT_PUBLIC_API_URL=${{ vars.NEXT_PUBLIC_API_URL != '' && vars.NEXT_PUBLIC_API_URL || 'http://localhost:8080/api' }}
108108
cache-from: type=gha
109109
cache-to: type=gha,mode=max

apps/web/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ COPY --from=deps /app/packages/tailwind-config/node_modules ./packages/tailwind-
5050
# Copy source code
5151
COPY . .
5252

53-
# Build arguments for environment variables needed at build time
54-
ARG NEXT_PUBLIC_API_URL
55-
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
53+
# Build arguments for environment variables needed at build time.
54+
# Default keeps CI/CD builds working even when build-arg is omitted.
55+
ARG NEXT_PUBLIC_API_URL=http://localhost:8080/api
56+
ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL}
5657

5758
# Build the web app (standalone output configured in next.config.ts)
5859
RUN pnpm --filter @repo/web build

0 commit comments

Comments
 (0)