Every SmartLogix service is configured entirely through environment variables. The values below are read at container startup; changing them requires restarting (or rebuilding) the affected container. Default values are defined in each service’s application.properties and are used when a variable is not set.
The JWT_SECRET value in docker-compose.yml (bXlTZWN1cmVTZWNyZXRLZXkxMjM0NTY3ODkwQUJDREU=) is a public placeholder committed to the repository. It must be replaced with a privately generated secret before deploying to any environment accessible over a network. Anyone who knows this value can forge valid tokens.
Shared secret
JWT_SECRET is the only variable that must be identical across two services. If the values diverge, the gateway will reject every token issued by the auth-service.
| Variable | Services | Required | Description |
|---|
JWT_SECRET | api-gateway, auth-service | Yes | Base64-encoded HMAC-SHA key used to sign and verify JWTs. Must be the same value in both services. |
Generate a secure value:
Set it in the environment before running docker compose up:
export JWT_SECRET=$(openssl rand -base64 32)
Or add it to a .env file in the project root (Docker Compose loads .env automatically):
JWT_SECRET=<your-generated-value>
API gateway (api-gateway)
| Variable | Required | Default | Description |
|---|
JWT_SECRET | Yes | bXlTZWN1cmVTZWNyZXRLZXkxMjM0NTY3ODkwQUJDREU= | Shared HMAC-SHA key for JWT verification. See Shared secret. |
The gateway exposes Actuator at /actuator/health and /actuator/info. No database connection is required.
Auth service (auth-service)
| Variable | Required | Default | Description |
|---|
JWT_SECRET | Yes | (none) | Shared HMAC-SHA key for JWT signing. Must match the gateway. |
DB_HOST | Yes | localhost | Hostname of the PostgreSQL instance (postgres-auth in Docker). |
DB_NAME | Yes | auth_db | Database name. |
DB_USER | Yes | postgres | Database username. |
DB_PASS | Yes | secret | Database password. |
Additional properties (configured in application.properties, not overridable via env by default):
| Property | Value | Description |
|---|
jwt.expiration | 86400000 | Token lifetime in milliseconds (24 hours). |
jwt.expiration is a Spring property key, not an environment variable. To change it you must edit auth-service/src/main/resources/application.properties and rebuild the image.
Inventory service (ms-inventario)
| Variable | Required | Default | Description |
|---|
DB_HOST | Yes | localhost | Hostname of the PostgreSQL instance (postgres-inventario in Docker). |
DB_NAME | Yes | inventario_db | Database name. |
DB_USER | Yes | postgres | Database username. |
DB_PASS | Yes | secret | Database password. |
Orders service (ms-pedidos)
| Variable | Required | Default | Description |
|---|
DB_HOST | Yes | localhost | Hostname of the PostgreSQL instance (postgres-pedidos in Docker). |
DB_NAME | Yes | pedidos_db | Database name. |
DB_USER | Yes | postgres | Database username. |
DB_PASS | Yes | secret | Database password. |
The orders service also connects to ms-inventario via the hardcoded property inventario.service.url=http://ms-inventario:8082. This value relies on Docker Compose service name resolution and does not need to change in a standard Docker deployment.
Shipping service (ms-envios)
| Variable | Required | Default | Description |
|---|
DB_HOST | Yes | localhost | Hostname of the PostgreSQL instance (postgres-envios in Docker). |
DB_NAME | Yes | envios_db | Database name. |
DB_USER | Yes | postgres | Database username. |
DB_PASS | Yes | secret | Database password. |
Notification service (notification-service)
The notification service has no environment variables defined in docker-compose.yml. It starts with the defaults embedded in its application configuration.
Frontend (frontend)
| Variable | Required | Default | Description |
|---|
VITE_API_URL | No | http://localhost:8080/api | Base URL for all API requests from the React app. Must be reachable from the user’s browser, not from inside the Docker network. |
VITE_API_URL is a Vite build-time variable. It is baked into the compiled JavaScript bundle at npm run build time. Changing it after the image is built has no effect — you must set the variable and rebuild the image with docker compose up -d --build frontend.
For a production deployment behind a load balancer or reverse proxy, set VITE_API_URL to your public API gateway URL:
# .env
VITE_API_URL=https://api.smartlogix.example.com/api
Docker Compose defaults at a glance
The table below summarises every value docker-compose.yml sets explicitly. All other values fall back to the per-service application.properties defaults shown in the sections above.
| Service | Variable | Value in docker-compose.yml |
|---|
api-gateway | JWT_SECRET | bXlTZWN1cmVTZWNyZXRLZXkxMjM0NTY3ODkwQUJDREU= |
auth-service | JWT_SECRET | bXlTZWN1cmVTZWNyZXRLZXkxMjM0NTY3ODkwQUJDREU= |
auth-service | DB_HOST | postgres-auth |
auth-service | DB_NAME | auth_db |
auth-service | DB_USER | postgres |
auth-service | DB_PASS | secret |
ms-inventario | DB_HOST | postgres-inventario |
ms-inventario | DB_NAME | inventario_db |
ms-inventario | DB_USER | postgres |
ms-inventario | DB_PASS | secret |
ms-pedidos | DB_HOST | postgres-pedidos |
ms-pedidos | DB_NAME | pedidos_db |
ms-pedidos | DB_USER | postgres |
ms-pedidos | DB_PASS | secret |
ms-envios | DB_HOST | postgres-envios |
ms-envios | DB_NAME | envios_db |
ms-envios | DB_USER | postgres |
ms-envios | DB_PASS | secret |