Fix build by removing DB_URI build argument and using dummy connection

This commit is contained in:
yznahmad 2025-06-20 02:18:45 +03:00
parent 40ed4d773e
commit 750ef0398f
2 changed files with 5 additions and 4 deletions

View File

@ -25,8 +25,6 @@ services:
build:
context: .
dockerfile: webapp/Dockerfile
args:
- DB_URI=${DB_URI}
container_name: infinity-webapp
restart: always
depends_on:

View File

@ -11,10 +11,13 @@ RUN npm ci
COPY webapp/ .
# Set environment variables for build
ARG DB_URI
ENV DB_URI=${DB_URI:-"mongodb://dummy:password@localhost:27017/dummy"}
# Use a dummy DB_URI during build to prevent connection attempts
ENV DB_URI="mongodb://dummy:password@localhost:27017/dummy"
ENV NODE_ENV=production
# Disable Next.js telemetry during build
ENV NEXT_TELEMETRY_DISABLED=1
# Build the application
RUN npm run build