This project uses environment variables as the single source of truth for all configuration.
.env file (local, git-ignored)
↓
Environment Variables (UPPERCASE)
↓
MicroProfile Config (reads at runtime)
↓
Java Application
Important: We do NOT use Maven resource filtering anymore. Properties files are copied as-is during build.
Configuration values are read at runtime from environment variables, not replaced during build time.
All environment variables use UPPERCASE names:
# ✅ Correct
POSTGRES_JEEERAAAH_DATABASE=jeeeraaah
POSTGRES_JEEERAAAH_USER=jeeeraaah
# ❌ Wrong (will not work)
postgres_jeeeraaah_database=jeeeraaah
postgres_jeeeraaah_user=jeeeraaah
.env (Single Source of Truth)Location: config/shared/docker/.env
Example:
POSTGRES_JEEERAAAH_HOST=localhost
POSTGRES_JEEERAAAH_PORT=5432
POSTGRES_JEEERAAAH_DATABASE=jeeeraaah
POSTGRES_JEEERAAAH_USER=jeeeraaah
POSTGRES_JEEERAAAH_PASSWORD=secret123
.env.templateLocation: config/shared/docker/.env.template
.envLocation: **/META-INF/microprofile-config.properties
${VAR_NAME:fallback}Example:
database.host=${POSTGRES_JEEERAAAH_HOST:localhost}
database.port=${POSTGRES_JEEERAAAH_PORT:5432}
database.name=${POSTGRES_JEEERAAAH_DATABASE:jeeeraaah}
database.user=${POSTGRES_JEEERAAAH_USER:jeeeraaah}
database.password=${POSTGRES_JEEERAAAH_PASSWORD:jeeeraaah}
.env Filecd ~/develop/github/java/main/config/shared/docker
cp .env.template .env
# Edit .env and set real passwords
Docker Compose automatically reads .env and sets environment variables for containers.
docker compose up -d
Option A: Set environment variables in Run Configuration
Option B: Export in shell before starting IntelliJ
export POSTGRES_JEEERAAAH_HOST=localhost
export POSTGRES_JEEERAAAH_PORT=5432
# ... etc
| Variable | Default | Description |
|---|---|---|
POSTGRES_JEEERAAAH_HOST |
localhost |
PostgreSQL host |
POSTGRES_JEEERAAAH_PORT |
5432 |
PostgreSQL port |
POSTGRES_JEEERAAAH_DATABASE |
jeeeraaah |
Database name |
POSTGRES_JEEERAAAH_USER |
jeeeraaah |
Database user |
POSTGRES_JEEERAAAH_PASSWORD |
jeeeraaah |
Database password |
| Variable | Default | Description |
|---|---|---|
POSTGRES_LIB_TEST_DATABASE |
lib_test |
Test database name |
POSTGRES_LIB_TEST_USER |
lib_test |
Test database user |
POSTGRES_LIB_TEST_PASSWORD |
lib_test |
Test database password |
Note: lib_test uses the same PostgreSQL container as jeeeraaah (host/port).
| Variable | Default | Description |
|---|---|---|
POSTGRES_KEYCLOAK_HOST |
localhost |
Keycloak PostgreSQL host |
POSTGRES_KEYCLOAK_PORT |
5433 |
Keycloak PostgreSQL port |
POSTGRES_KEYCLOAK_DATABASE |
keycloak |
Keycloak database name |
POSTGRES_KEYCLOAK_USER |
keycloak |
Keycloak database user |
POSTGRES_KEYCLOAK_PASSWORD |
keycloak |
Keycloak database password |
| Variable | Default | Description |
|---|---|---|
KEYCLOAK_ADMIN_USER |
admin |
Keycloak admin username |
KEYCLOAK_ADMIN_PASSWORD |
admin |
Keycloak admin password |
KEYCLOAK_REALM |
jeeeraaah-realm |
Keycloak realm name |
Cause: MicroProfile Config didn’t find the environment variable, so it used the fallback value literally.
Solution:
.env file exists: ls -la ~/develop/github/java/main/config/shared/docker/.env.envdocker compose down && docker compose up -dCause: Maven resource filtering is enabled.
Solution:
pom.xml - <filtering> should be false<filtering>true</filtering>Solution:
Old system used:
config.properties (local, git-ignored)New system uses:
.env file (local, git-ignored)No migration needed - just create .env file and rebuild.
microprofile-config.properties.env file git-ignored.env.template when adding new variables