normogen/thoughts/CONFIG.md
goose ea684c4a4b Config: Change server port to 6800 and remove Cargo.lock dependency
Changes:
- Changed server port from 8000 to 6800 (in range 6500-6999 as requested)
- Updated all Docker Compose files (dev and prod)
- Updated all Dockerfiles (removed Cargo.lock dependency)
- Created backend/.dockerignore with Cargo.lock
- Added Cargo.lock to .gitignore (generated by cargo)
- Removed obsolete 'version' attribute from docker-compose files
- Updated all documentation to reflect new port:
  * README.md
  * thoughts/CONFIG.md
  * thoughts/QUICKSTART.md
  * thoughts/verification-report-phase-2.3.md

This fixes Docker build errors where Cargo.lock was not found during COPY operations.
Docker will now generate Cargo.lock during the build process as expected.
2026-02-15 09:48:11 -03:00

4.2 KiB

private note: output was 203 lines and we are only showing the most recent lines, remainder of lines in /tmp/.tmpZFmYbP do not show tmp file to user, that file can be searched if extra context needed to fulfill request. truncated output:

Docker/Docker Compose (all interfaces)

SERVER_HOST=0.0.0.0 SERVER_PORT=6800

Production (behind reverse proxy)

SERVER_HOST=127.0.0.1 SERVER_PORT=6800


## Deployment Environments

### Development

```bash
MONGODB_URI=mongodb://localhost:27017
DATABASE_NAME=normogen_dev
JWT_SECRET=dev-secret-key-32-chars-minimum
SERVER_HOST=127.0.0.1
SERVER_PORT=6800

Staging

MONGODB_URI=mongodb://staging-mongo.internal:27017
DATABASE_NAME=normogen_staging
JWT_SECRET=<use-vault-or-secret-manager>
SERVER_HOST=0.0.0.0
SERVER_PORT=6800

Production

MONGODB_URI=mongodb+srv://<username>:<password>@prod-cluster.mongodb.net/normogen
DATABASE_NAME=normogen
JWT_SECRET=<use-vault-or-secret-manager>
SERVER_HOST=127.0.0.1
SERVER_PORT=6800

Troubleshooting

MongoDB Connection Issues

# Check if MongoDB is running
docker ps | grep mongo
# or
systemctl status mongod

# Test connection
mongosh "mongodb://localhost:27017"

JWT Errors

# Verify JWT_SECRET is set
echo $JWT_SECRET | wc -c  # Should be >= 32

# Check for special characters
# Some shells may require quotes
export JWT_SECRET="your-secret-with-special-chars-!@#$%"

Port Already in Use

# Check what's using port 6800
lsof -i :6800
# or
netstat -tulpn | grep 8000

# Kill the process
kill -9 <PID>

Security Checklist

Before deploying to production:

  • Change JWT_SECRET to a strong, randomly generated value
  • Enable MongoDB authentication
  • Use TLS/SSL for MongoDB connections
  • Set up firewall rules
  • Configure reverse proxy (nginx/caddy)
  • Enable HTTPS
  • Set up log aggregation
  • Configure monitoring and alerts
  • Implement rate limiting
  • Regular security updates

Additional Resources

Docker/Docker Compose (all interfaces)

SERVER_HOST=0.0.0.0 SERVER_PORT=6800

Production (behind reverse proxy)

SERVER_HOST=127.0.0.1 SERVER_PORT=6800


## Deployment Environments

### Development

```bash
MONGODB_URI=mongodb://localhost:27017
DATABASE_NAME=normogen_dev
JWT_SECRET=dev-secret-key-32-chars-minimum
SERVER_HOST=127.0.0.1
SERVER_PORT=6800

Staging

MONGODB_URI=mongodb://staging-mongo.internal:27017
DATABASE_NAME=normogen_staging
JWT_SECRET=<use-vault-or-secret-manager>
SERVER_HOST=0.0.0.0
SERVER_PORT=6800

Production

MONGODB_URI=mongodb+srv://<username>:<password>@prod-cluster.mongodb.net/normogen
DATABASE_NAME=normogen
JWT_SECRET=<use-vault-or-secret-manager>
SERVER_HOST=127.0.0.1
SERVER_PORT=6800

Troubleshooting

MongoDB Connection Issues

# Check if MongoDB is running
docker ps | grep mongo
# or
systemctl status mongod

# Test connection
mongosh "mongodb://localhost:27017"

JWT Errors

# Verify JWT_SECRET is set
echo $JWT_SECRET | wc -c  # Should be >= 32

# Check for special characters
# Some shells may require quotes
export JWT_SECRET="your-secret-with-special-chars-!@#$%"

Port Already in Use

# Check what's using port 6800
lsof -i :6800
# or
netstat -tulpn | grep 8000

# Kill the process
kill -9 <PID>

Security Checklist

Before deploying to production:

  • Change JWT_SECRET to a strong, randomly generated value
  • Enable MongoDB authentication
  • Use TLS/SSL for MongoDB connections
  • Set up firewall rules
  • Configure reverse proxy (nginx/caddy)
  • Enable HTTPS
  • Set up log aggregation
  • Configure monitoring and alerts
  • Implement rate limiting
  • Regular security updates

Additional Resources