cgs-lab is the devilbox environment for the CGS project that provides Apache 2.4, PHP 8.2, and PostgreSQL 17 + PostGIS, safe coexistence with the production Nginx stack.
This Devilbox environment provides:
- Apache 2.4
- PHP 8.2
- PostgreSQL 17 + PostGIS
- Safe coexistence with production Nginx stack
| Service | Port |
|---|---|
| HTTP | 8585 |
| HTTPS | 9443 |
| PostgreSQL | 5433 |
Local project path: ~/projects/CGS
Mapped into Devilbox at: devilbox/data/www/CGS
Access URL: http://dev.example.com:8585/CGS
cd ~/devilbox
docker compose up -d
## Stop Stack
docker compose down
PostgreSQL Connection
Field Value
Host 127.0.0.1
Port 5433
User devilbox
Pass devilbox
DB devilbox
PostGIS is pre-enabled.
---
No changes are made to production ports 80/443.
---
## Future Architecture (Phase 2)
Once the stack is validated:
- Move Devilbox behind Nginx reverse proxy
- Serve at:
https://dev.example.com
- Enable TLS via Certbot
- Remove exposed high ports
---
## Repo Structure
dev-environment-setup/
├── README.md
├── devilbox/
│ ├── .env
│ └── README.md
└── nginx-reverse-proxy/
└── dev.example.com.conf
---
## Quick Start
```bash
cd ~/devilbox
cp ~/cgs-lab-setup/devilbox/.env .env
docker compose up -d
Status
This environment is:
✅ Isolated
✅ Reproducible
✅ Production-safe
✅ Future-migratable
---
# Future Nginx Reverse Proxy Config (Phase 2)
Save as:
cgs-lab-setup/nginx-reverse-proxy/dev.example.com.conf
```nginx
server {
listen 80;
server_name dev.example.com;
location / {
proxy_pass http://127.0.0.1:8585;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
✅ 7. Final Run Commands (Live System)
cd ~/devilbox
cp ~/cgs-lab-setup/devilbox/.env .env
docker compose up -d
Then open:
http://dev.example.com:8585/CGS
You now have:
A production-safe Devilbox dev stack
A versioned DevOps documentation repo
A future migration path to clean subdomain + HTTPS
A setup that mirrors your local XAMPP → PostgreSQL workflow