From eb1acaf71158dd339da605929dcece097ea3c478 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 29 Dec 2025 08:09:02 +0000 Subject: [PATCH] Fix Docker build context paths and add runtime API URL configuration Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com> --- backend/Dockerfile | 6 +++--- docker-compose.yml | 2 +- frontend/Dockerfile | 2 -- frontend/next.config.js | 3 --- frontend/src/app/account/page.jsx | 2 +- frontend/src/app/admin/page.jsx | 2 +- frontend/src/app/docs/page.jsx | 2 +- frontend/src/app/login/page.jsx | 2 +- frontend/src/app/publish/page.jsx | 2 +- 9 files changed, 9 insertions(+), 14 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 0238410..98e11b4 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -3,14 +3,14 @@ FROM python:3.11-slim WORKDIR /app # Install dependencies -COPY requirements.txt . +COPY backend/requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application files -COPY app.py auth.py ./ +COPY backend/app.py backend/auth.py backend/config_db.py ./ # Copy schema from parent directory -COPY ../schema.json /app/schema.json +COPY schema.json /app/schema.json # Create data directory RUN mkdir -p /data/blobs /data/meta diff --git a/docker-compose.yml b/docker-compose.yml index dae411c..ed2b39e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,7 +24,7 @@ services: ports: - "3000:3000" environment: - - API_URL=http://backend:5000 + - NEXT_PUBLIC_API_URL=http://backend:5000 - NODE_ENV=production depends_on: - backend diff --git a/frontend/Dockerfile b/frontend/Dockerfile index ecf8fa5..21212ad 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -14,8 +14,6 @@ WORKDIR /app COPY --from=deps /app/node_modules ./node_modules COPY . . -# Set API URL for build (can be overridden at runtime) -ENV API_URL=http://backend:5000 ENV NEXT_TELEMETRY_DISABLED=1 RUN npm run build diff --git a/frontend/next.config.js b/frontend/next.config.js index 26fff45..5cd8cc3 100644 --- a/frontend/next.config.js +++ b/frontend/next.config.js @@ -1,8 +1,5 @@ /** @type {import('next').NextConfig} */ const nextConfig = { - env: { - API_URL: process.env.API_URL || 'http://localhost:5000', - }, output: 'standalone', } diff --git a/frontend/src/app/account/page.jsx b/frontend/src/app/account/page.jsx index 11e058a..7b03144 100644 --- a/frontend/src/app/account/page.jsx +++ b/frontend/src/app/account/page.jsx @@ -50,7 +50,7 @@ export default function AccountPage() { setLoading(true); try { - const apiUrl = process.env.API_URL || 'http://localhost:5000'; + const apiUrl = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:5000'; const token = localStorage.getItem('token'); const response = await fetch(`${apiUrl}/auth/change-password`, { diff --git a/frontend/src/app/admin/page.jsx b/frontend/src/app/admin/page.jsx index 91f817a..ba1e7ef 100644 --- a/frontend/src/app/admin/page.jsx +++ b/frontend/src/app/admin/page.jsx @@ -35,7 +35,7 @@ export default function AdminPage() { const fetchConfig = async () => { try { - const apiUrl = process.env.API_URL || 'http://localhost:5000'; + const apiUrl = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:5000'; const token = localStorage.getItem('token'); const response = await fetch(`${apiUrl}/admin/config`, { headers: { diff --git a/frontend/src/app/docs/page.jsx b/frontend/src/app/docs/page.jsx index 5163e84..0502ec2 100644 --- a/frontend/src/app/docs/page.jsx +++ b/frontend/src/app/docs/page.jsx @@ -82,7 +82,7 @@ docker-compose up -d
goodrepo-frontendfrontend/captain-definitionAPI_URL = https://goodrepo-backend.your-domain.comNEXT_PUBLIC_API_URL = https://goodrepo-backend.your-domain.com