Refactor API URLs and add environment config example

Replaces hardcoded production API URLs with localhost defaults for local development in both server and client code. Updates Dockerfile to require API URLs via deployment environment variables. Improves ChatTable to use a batch endpoint for chats and unread counts, with backward compatibility. Adds an env.example file to document required environment variables. Updates next.config.mjs to use environment variables for backend API rewrites and image domains.
This commit is contained in:
NotII
2025-09-01 15:35:10 +01:00
parent 3528ca45cc
commit 29ec1be68c
8 changed files with 74 additions and 29 deletions

View File

@@ -39,7 +39,10 @@ EXPOSE 3000
ENV NODE_ENV=production
ENV NEXT_PUBLIC_API_URL=/api
ENV SERVER_API_URL=https://internal-api.inboxi.ng/api
# Backend API URL should be set via deployment environment
# ENV SERVER_API_URL=set_via_deployment
# ENV API_BASE_URL=set_via_deployment
# ENV API_HOSTNAME=set_via_deployment
# Set GIT_COMMIT_SHA environment variable in the final image by reading the file
ENV GIT_COMMIT_SHA="$(cat /app/git_commit_sha)"