diff --git a/.env.tor b/.env.tor index 0667fff..df5d15d 100644 --- a/.env.tor +++ b/.env.tor @@ -2,4 +2,8 @@ # Using relative URLs for maximum compatibility NEXT_PUBLIC_API_URL=/api # Flag to indicate we're running in Tor mode -NEXT_PUBLIC_TOR_MODE=true \ No newline at end of file +NEXT_PUBLIC_TOR_MODE=true +# Force relative URLs for internal API communication +SERVER_API_URL=http://localhost:3000/api +# Disable HTTPS for internal container communication +USE_HTTPS=false \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 72a5270..3173c91 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,9 @@ RUN npm install --force COPY . . +# Set build-time environment variables to use relative URLs ENV NEXT_PUBLIC_API_URL=/api +ENV NEXT_TELEMETRY_DISABLED=1 # Build the Next.js application RUN npm run build @@ -34,8 +36,17 @@ COPY --from=builder /app/backend ./backend EXPOSE 3000 +# Set runtime environment variables ENV NODE_ENV=production ENV NEXT_PUBLIC_API_URL=/api +# Force server to use internal URLs (no localhost references) +ENV SERVER_API_URL=http://localhost:3000/api +# Disable HTTPS for internal container communication +ENV USE_HTTPS=false +# Ensure internal API calls for server components go to the right port +ENV INTERNAL_API_PORT=3000 +# Disable telemetry +ENV NEXT_TELEMETRY_DISABLED=1 # Start Next.js server CMD ["npm", "run", "start:tor"] \ No newline at end of file