-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
53 lines (38 loc) · 1.57 KB
/
.env.example
File metadata and controls
53 lines (38 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Environment Variables Configuration
This file lists all environment variables used by the application.
## Required Environment Variables
### Database Configuration
- `SPRING_DATASOURCE_URL` - Full JDBC connection string (default: `jdbc:mysql://localhost:3306/world`)
- `DB_USER` - Database username (default: `root`)
- `DB_PASSWORD` - Database password (default: `root`)
## Optional Environment Variables
### Database Connection Pool
- `DB_POOL_SIZE` - Maximum database connection pool size (default: `10`)
- `DB_POOL_MIN_IDLE` - Minimum idle connections (default: `2`)
### Server Configuration
- `SERVER_PORT` - Application server port (default: `8080`)
### Logging
- `LOG_LEVEL` - Root log level: TRACE, DEBUG, INFO, WARN, ERROR (default: `INFO`)
- `APP_LOG_LEVEL` - Application-specific log level (default: `INFO`)
- `SHOW_SQL` - Show SQL queries in logs: true/false (default: `false`)
## Local Development
For local development, you can create a `.env` file (not committed to git):
```env
# Local Development Settings
DB_USER=root
DB_PASSWORD=root
SPRING_DATASOURCE_URL=jdbc:mysql://localhost:3306/world
SHOW_SQL=true
LOG_LEVEL=DEBUG
```
## Docker/Docker Compose
Environment variables are configured in `docker-compose.yml`.
## AWS Deployment
For AWS deployment (ECS/EKS/App Runner):
- Store secrets in **AWS Secrets Manager** or **Parameter Store**
- Set environment variables in task definition or deployment configuration
- Use RDS endpoint for `SPRING_DATASOURCE_URL`
Example for AWS RDS:
```
SPRING_DATASOURCE_URL=jdbc:mysql://world-db.xxxxx.us-east-1.rds.amazonaws.com:3306/world
```