Skip to content

fix: env vars in docker-compose.yaml#20

Open
dpatsora wants to merge 1 commit intomasterfrom
fix/compose-env-vars
Open

fix: env vars in docker-compose.yaml#20
dpatsora wants to merge 1 commit intomasterfrom
fix/compose-env-vars

Conversation

@dpatsora
Copy link
Contributor

@dpatsora dpatsora commented Mar 5, 2026

Summary by CodeRabbit

  • Chores
    • Updated service configuration environment variables to support RPC endpoint, contract address, and private key settings. Standardized configuration path variable naming for consistency.

@coderabbitai
Copy link

coderabbitai bot commented Mar 5, 2026

📝 Walkthrough

Walkthrough

The docker-compose.yml configuration is updated to rename an environment variable and introduce three new configuration parameters for the nitewatch service, enabling RPC connectivity, contract address, and private key management.

Changes

Cohort / File(s) Summary
Docker Configuration
docker-compose.yml
Renamed NITEWATCH_CONFIG to NITEWATCH_CONFIG_PATH and added three new environment variables (NITEWATCH_RPC_URL, NITEWATCH_CONTRACT_ADDRESS, NITEWATCH_PRIVATE_KEY) with placeholder values in the nitewatch service.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • feat: local docker compose setup #19: Introduces the initial nitewatch service configuration in docker-compose.yml that this PR directly modifies and extends with additional environment variables.

Poem

🐰 Configuration hops, environment grows,
RPC paths and addresses in a row,
Keys tucked safe with placeholder glow,
The docker compose dance, a gentle flow! 🔑

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: env vars in docker-compose.yaml' accurately reflects the main change: updating environment variables in the docker-compose configuration file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/compose-env-vars

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
docker-compose.yml (1)

13-15: Use required variable substitution and .env file to eliminate hardcoded placeholders.

The changeme values on lines 13–15 lack validation, making runtime failures unclear. Use ${VAR:?error} syntax with an .env file to fail fast when secrets are missing:

 services:
   nitewatch:
+    env_file:
+      - .env
     environment:
       NITEWATCH_CONFIG_PATH: /app/config.yaml
       NITEWATCH_DB_PATH: /app/data/nitewatch.db
-      NITEWATCH_RPC_URL: changeme
-      NITEWATCH_CONTRACT_ADDRESS: changeme
-      NITEWATCH_PRIVATE_KEY: changeme
+      NITEWATCH_RPC_URL: ${NITEWATCH_RPC_URL:?Set NITEWATCH_RPC_URL in .env}
+      NITEWATCH_CONTRACT_ADDRESS: ${NITEWATCH_CONTRACT_ADDRESS:?Set NITEWATCH_CONTRACT_ADDRESS in .env}
+      NITEWATCH_PRIVATE_KEY: ${NITEWATCH_PRIVATE_KEY:?Set NITEWATCH_PRIVATE_KEY in .env}

Note: This syntax is supported in Docker Compose 1.19.0+. However, environment variables remain visible via docker inspect. For production use of sensitive credentials like NITEWATCH_PRIVATE_KEY, consider Docker Secrets (file mounts under /run/secrets/) or mounting from external configuration files instead.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docker-compose.yml` around lines 13 - 15, Replace the hardcoded "changeme"
placeholders for NITEWATCH_RPC_URL, NITEWATCH_CONTRACT_ADDRESS and
NITEWATCH_PRIVATE_KEY in docker-compose.yml with required variable substitution
(e.g., ${NITEWATCH_RPC_URL:?NITEWATCH_RPC_URL required}) and document/populate
those values in an .env file for local dev; for production move sensitive
NITEWATCH_PRIVATE_KEY into Docker Secrets or a mounted config file and update
the compose service to read from /run/secrets or the mounted path instead.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docker-compose.yml`:
- Around line 13-15: Replace the hardcoded "changeme" placeholders for
NITEWATCH_RPC_URL, NITEWATCH_CONTRACT_ADDRESS and NITEWATCH_PRIVATE_KEY in
docker-compose.yml with required variable substitution (e.g.,
${NITEWATCH_RPC_URL:?NITEWATCH_RPC_URL required}) and document/populate those
values in an .env file for local dev; for production move sensitive
NITEWATCH_PRIVATE_KEY into Docker Secrets or a mounted config file and update
the compose service to read from /run/secrets or the mounted path instead.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d73c356b-16a4-4534-90c0-585997ed2ae5

📥 Commits

Reviewing files that changed from the base of the PR and between 2c96d24 and 9040a53.

📒 Files selected for processing (1)
  • docker-compose.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant