feat: configurable backend url

This commit is contained in:
Leon
2025-07-22 19:04:32 +02:00
parent 1d99db6c19
commit baf393fe96
4 changed files with 15 additions and 9 deletions

View File

@@ -1,17 +1,18 @@
# The base URL of the application, e.g., http://localhost:3000 or https://letterfeed.example.com
LETTERFEED_APP_BASE_URL=http://localhost:3000
# LETTERFEED_APP_BASE_URL=http://localhost:3000
# LETTERFEED_BACKEND_URL=http://backend:8000 # URL of the backend service
# The database URL. Change this if you change the volume mount point
LETTERFEED_DATABASE_URL=sqlite:////data/letterfeed.db
# LETTERFEED_DATABASE_URL=sqlite:////data/letterfeed.db
# IMAP server settings. Must have IMAP over SSL on port 993
LETTERFEED_IMAP_SERVER=
LETTERFEED_IMAP_USERNAME=
LETTERFEED_IMAP_PASSWORD=
# LETTERFEED_IMAP_SERVER=
# LETTERFEED_IMAP_USERNAME=
# LETTERFEED_IMAP_PASSWORD=
# Email processing settings
LETTERFEED_SEARCH_FOLDER=INBOX # The folder in which to search for new emails
# LETTERFEED_MOVE_TO_FOLDER= # Optional: Folder to move processed emails
# LETTERFEED_SEARCH_FOLDER=INBOX # The folder in which to search for new emails
# LETTERFEED_MOVE_TO_FOLDER= # Folder to move processed emails
# LETTERFEED_MARK_AS_READ=true # Mark processed emails as read
# LETTERFEED_EMAIL_CHECK_INTERVAL=15 # Interval between checks for new emails
# LETTERFEED_AUTO_ADD_NEW_SENDERS=false # Automatically set up new emails for unknown senders

View File

@@ -16,6 +16,8 @@ services:
context: ./frontend
dockerfile: Dockerfile
restart: unless-stopped
env_file:
- .env
ports:
- "3000:3000"
depends_on:

View File

@@ -12,6 +12,8 @@ services:
frontend:
image: ghcr.io/leonmuscoden/letterfeed-frontend:latest
restart: unless-stopped
env_file:
- .env
ports:
- "3000:3000"
depends_on:

View File

@@ -2,10 +2,11 @@ import type { NextConfig } from "next";
const nextConfig: NextConfig = {
async rewrites() {
const backendUrl = process.env.LETTERFEED_BACKEND_URL || "http://backend:8000";
return [
{
source: '/api/:path*',
destination: 'http://backend:8000/:path*',
source: "/api/:path*",
destination: `${backendUrl}/:path*`,
},
];
},