25 Commits

Author SHA1 Message Date
Zamil Majdy
4bfeddc03d feat(platform/docker): add frontend service to docker-compose with env config improvements (#10615)
## Summary
This PR adds the frontend service to the Docker Compose configuration,
enabling `docker compose up` to run the complete stack, including the
frontend. It also implements comprehensive environment variable
improvements, unified .env file support, and fixes Docker networking
issues.

## Key Changes

### 🐳 Docker Compose Improvements
- **Added frontend service** to `docker-compose.yml` and
`docker-compose.platform.yml`
- **Production build**: Uses `pnpm build + serve` instead of dev server
for better stability and lower memory usage
- **Service dependencies**: Frontend now waits for backend services
(`rest_server`, `websocket_server`) to be ready
- **YAML anchors**: Implemented DRY configuration to avoid duplicating
environment values

### 📁 Unified .env File Support
- **Frontend .env loading**: Automatically loads `.env` file during
Docker build and runtime
- **Backend .env loading**: Optional `.env` file support with fallback
to sensible defaults in `settings.py`
- **Single source of truth**: All `NEXT_PUBLIC_*` and API keys can be
defined in respective `.env` files
- **Docker integration**: Updated `.dockerignore` to include `.env`
files in build context
- **Git tracking**: Frontend and backend `.env` files are now trackable
(removed from gitignore)

### 🔧 Environment Variable Architecture
- **Dual environment strategy**: 
- Server-side code uses Docker service names
(`http://rest_server:8006/api`)
  - Client-side code uses localhost URLs (`http://localhost:8006/api`)
- **Comprehensive config**: Added build args and runtime environment
variables
- **Network compatibility**: Fixes connection issues between frontend
and backend containers
- **Shared backend variables**: Common environment variables (service
hosts, auth settings) centralized using YAML anchors

### 🛠️ Code Improvements
- **Centralized env-config helper** (`/frontend/src/lib/env-config.ts`)
with server-side priority
- **Updated all frontend code** to use shared environment helpers
instead of direct `process.env` access
- **Consistent API**: All environment variable access now goes through
helper functions
- **Settings.py improvements**: Better defaults for CORS origins and
optional .env file loading

### 🔗 Files Changed
- `docker-compose.yml` & `docker-compose.platform.yml` - Added frontend
service and shared backend env vars
- `frontend/Dockerfile` - Simplified build process to use .env files
directly
- `backend/settings.py` - Optional .env loading and better defaults
- `frontend/src/lib/env-config.ts` - New centralized environment
configuration
- `.dockerignore` - Allow .env files in build context
- `.gitignore` - Updated to allow frontend/backend .env files
- Multiple frontend files - Updated to use env helpers
- Updates to both auto installer scripts to work with the latest setup!

## Benefits
-  **Single command deployment**: `docker compose up` now runs
everything
-  **Better reliability**: Production build reduces memory usage and
crashes
-  **Network compatibility**: Proper container-to-container
communication
-  **Maintainable config**: Centralized environment variable management
with .env files
-  **Development friendly**: Works in both Docker and local development
-  **API key management**: Easy configuration through .env files for
all services
-  **No more manual env vars**: Frontend and backend automatically load
their respective .env files

## Testing
-  Verified Docker service communication works correctly
-  Frontend responds and serves content properly  
-  Environment variables are correctly resolved in both server and
client contexts
-  No connection errors after implementing service dependencies
-  .env file loading works correctly in both build and runtime phases
-  Backend services work with and without .env files present

### Checklist 📋

#### For configuration changes:
- [x] `.env.default` is updated or already compatible with my changes
- [x] `docker-compose.yml` is updated or already compatible with my
changes
- [x] I have included a list of my configuration changes in the PR
description (under **Changes**)

🤖 Generated with [Claude Code](https://claude.ai/code)

---------

Co-authored-by: Lluis Agusti <hi@llu.lu>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Nicholas Tindle <nicholas.tindle@agpt.co>
Co-authored-by: Claude <claude@users.noreply.github.com>
Co-authored-by: Bentlybro <Github@bentlybro.com>
2025-08-14 03:28:18 +00:00
Reinier van der Leer
c960bd870c dx: Clean up PR template (#8541)
* dx: Clean up PR template
2024-11-08 17:44:55 +01:00
Aarushi
08a8abeb58 docs(pr_template): Add reminder for config and infra changes (#8430)
add config change reminder
2024-10-24 19:31:53 +01:00
Swifty
ef7cfbb860 refactor: AutoGPT Platform Stealth Launch Repo Re-Org (#8113)
Restructuring the Repo to make it clear the difference between classic autogpt and the autogpt platform:
* Move the "classic" projects `autogpt`, `forge`, `frontend`, and `benchmark` into a `classic` folder
  * Also rename `autogpt` to `original_autogpt` for absolute clarity
* Rename `rnd/` to `autogpt_platform/`
  * `rnd/autogpt_builder` -> `autogpt_platform/frontend`
  * `rnd/autogpt_server` -> `autogpt_platform/backend`
* Adjust any paths accordingly
2024-09-20 16:50:43 +02:00
Aarushi
e3f35d79c7 tweak(.github): Update pr template wording (#8103)
* update pr template wording

* add what and how

* Update .github/PULL_REQUEST_TEMPLATE.md

---------

Co-authored-by: Toran Bruce Richards <toran.richards@gmail.com>
2024-09-19 12:44:50 +00:00
Aarushi
0040495143 tweak(.github): Update PR template (#8100)
* update PR template

* Update .github/PULL_REQUEST_TEMPLATE.md

Co-authored-by: Krzysztof Czerwinski <34861343+kcze@users.noreply.github.com>

* add note

* typo

---------

Co-authored-by: Krzysztof Czerwinski <34861343+kcze@users.noreply.github.com>
2024-09-19 13:00:16 +01:00
Reinier van der Leer
8f18aebf90 Update wiki links to new location (Nexus/wiki -> AutoGPT/wiki) 2024-06-09 23:13:25 +02:00
merwanehamadi
8f41dbe27d Rename Auto-GPT to AutoGPT (#5301)
* Rename to AutoGPT

Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>

* Update autogpts/autogpt/BULLETIN.md

Co-authored-by: Reinier van der Leer <pwuts@agpt.co>

* Update BULLETIN.md

* Update docker-compose.yml

* Update autogpts/forge/tutorials/001_getting_started.md

Co-authored-by: Reinier van der Leer <pwuts@agpt.co>

* Update autogpts/autogpt/tests/unit/test_logs.py

Co-authored-by: Reinier van der Leer <pwuts@agpt.co>

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update introduction.md

* Update plugins.md

---------

Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
2023-09-22 15:49:29 -07:00
Reinier van der Leer
78cd591798 Update PR template 2023-09-06 15:47:49 +02:00
Reinier van der Leer
ea37eb95f9 Update PR template 2023-09-06 15:35:53 +02:00
merwanehamadi
5fcc6578c5 Update PULL_REQUEST_TEMPLATE.md 2023-09-05 20:45:45 -07:00
merwanehamadi
f41bf592b9 Test benchmark ci (#5157)
* Add gitignore

* test benchmark ci

Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>

---------

Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
2023-09-05 11:05:40 -07:00
Merwane Hamadi
8489052358 Move Auto-GPT to autogpts/autogpt 2023-09-05 09:40:24 -07:00
Erik Peterson
15c6b0c1c3 Implement directory-based plugin system (#4548)
* Implement directory-based plugin system

* Fix Selenium test

---------

Co-authored-by: Nicholas Tindle <nick@ntindle.com>
Co-authored-by: Merwane Hamadi <merwanehamadi@gmail.com>
2023-06-10 13:16:00 -07:00
merwanehamadi
ee9f10a8d8 remove unused imports automatically (#4449)
* remove unused imports automatically

* add linters to pr template

* remove useless try statement
2023-05-28 05:50:50 -07:00
Pi
6e14782f82 Re-point wiki link in PULL_REQUEST_TEMPLATE.md 2023-05-25 16:00:29 +01:00
Richard Beales
feae20d8fa Update PULL_REQUEST_TEMPLATE.md to include linting (#3625)
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
2023-05-16 23:24:57 -05:00
Pi
3df88be6cb Update PULL_REQUEST_TEMPLATE.md
Added link to wiki Contributing page
2023-05-05 23:03:09 +01:00
EH
fbdf9d4bd4 docs: add warning for non-essential contributions (#2359) 2023-04-18 14:21:57 +02:00
H-jj-R
8dadf79614 Spelling fixes 2023-04-17 13:25:49 +01:00
sagarishere
aa4118d4b9 Typo: in PULL_REQUEST_TEMPLATE.md
Typo
2023-04-13 11:27:15 +03:00
Robin Richtsfeld
d25c016154 Fixed typos 2023-04-12 02:56:37 +02:00
Toran Bruce Richards
ee1805c136 Update PULL_REQUEST_TEMPLATE.md 2023-04-10 04:21:44 +01:00
hunteraraujo
85428df9fc Update PULL_REQUEST_TEMPLATE.md 2023-04-06 10:07:49 -07:00
hunteraraujo
f8e88a146a Create PULL_REQUEST_TEMPLATE.md 2023-04-06 09:59:20 -07:00