.env.example83 lines, 2.8 KB
| 1 | # ============================================ |
| 2 | # ChatApp Microservices - Environment Variables |
| 3 | # ============================================ |
| 4 | # Copy this file to .env and fill in the values |
| 5 | # DO NOT commit .env to version control |
| 6 | # ============================================ |
| 7 | |
| 8 | # General |
| 9 | NODE_ENV=production |
| 10 | |
| 11 | RABBITMQ_URL=amqp://guest:guest@rabbitmq:5672 |
| 12 | REDIS_URL=redis://redis:6379 |
| 13 | MONGO_URL=mongodb://chatapp_mongo_user:testpassword@mongo:27017/chatapp_chat_service?authSource=admin |
| 14 | USER_DB_URL=postgres://chatapp_user:testpassword@user-db:5432/chatapp_user_service |
| 15 | AUTH_DB_URL=mysql://chatapp_auth_user:testpassword@auth-db:3306/chatapp_auth_service |
| 16 | |
| 17 | # ============================================ |
| 18 | # Security Secrets (REQUIRED - Generate secure values!) |
| 19 | # ============================================ |
| 20 | # Generate with: openssl rand -base64 48 |
| 21 | JWT_SECRET= |
| 22 | JWT_REFRESH_SECRET= |
| 23 | INTERNAL_API_TOKEN= |
| 24 | |
| 25 | # JWT Token Expiration |
| 26 | JWT_EXPIRES_IN=1d |
| 27 | JWT_REFRESH_EXPIRES_IN=30d |
| 28 | |
| 29 | # ============================================ |
| 30 | # Service Ports (External - for host access) |
| 31 | # ============================================ |
| 32 | GATEWAY_PORT=4000 |
| 33 | AUTH_SERVICE_PORT=4003 |
| 34 | USER_SERVICE_PORT=4001 |
| 35 | CHAT_SERVICE_PORT=4002 |
| 36 | |
| 37 | # ============================================ |
| 38 | # RabbitMQ Configuration |
| 39 | # ============================================ |
| 40 | RABBITMQ_USER=chatapp-rabbitmq |
| 41 | RABBITMQ_PASSWORD= |
| 42 | RABBITMQ_PORT=5672 |
| 43 | RABBITMQ_MANAGEMENT_PORT=15672 |
| 44 | |
| 45 | # ============================================ |
| 46 | # Redis Configuration |
| 47 | # ============================================ |
| 48 | REDIS_PORT=6379 |
| 49 | |
| 50 | # ============================================ |
| 51 | # MongoDB Configuration (Chat Service) |
| 52 | # ============================================ |
| 53 | MONGO_INITDB_ROOT_USERNAME=chatapp_mongo_user |
| 54 | MONGO_INITDB_ROOT_PASSWORD=testpassword |
| 55 | |
| 56 | # ============================================ |
| 57 | # PostgreSQL Configuration (User Service) |
| 58 | # ============================================ |
| 59 | USER_DB_NAME=chatapp_user_service |
| 60 | USER_DB_USER=chatapp_user |
| 61 | USER_DB_PASSWORD=testpassword |
| 62 | |
| 63 | # ============================================ |
| 64 | # MySQL Configuration (Auth Service) |
| 65 | # ============================================ |
| 66 | AUTH_DB_NAME=chatapp_auth_service |
| 67 | AUTH_DB_USER=chatapp_auth_user |
| 68 | AUTH_DB_PASSWORD=testpassword |
| 69 | AUTH_DB_ROOT_PASSWORD='' |
| 70 | |
| 71 | # ============================================ |
| 72 | # Dokploy Deployment Notes |
| 73 | # ============================================ |
| 74 | # 1. In Dokploy, create a new "Compose" project |
| 75 | # 2. Point to your repository containing this docker-compose.yml |
| 76 | # 3. Set these environment variables in Dokploy's UI |
| 77 | # 4. Expose the gateway-service port (4000) via Dokploy's domain settings |
| 78 | # |
| 79 | # For production, ensure you: |
| 80 | # - Generate strong random secrets for JWT_SECRET, JWT_REFRESH_SECRET, INTERNAL_API_TOKEN |
| 81 | # - Use strong passwords for all database credentials |
| 82 | # - Configure proper SSL/TLS via Dokploy's proxy settings |
| 83 | # ============================================ |