Skip to content

fix: add fallback default for HOST_DATA_DIR in docker-compose#1049

Open
mehmetkr-31 wants to merge 1 commit intobase:mainfrom
mehmetkr-31:fix/docker-compose-host-data-dir-default
Open

fix: add fallback default for HOST_DATA_DIR in docker-compose#1049
mehmetkr-31 wants to merge 1 commit intobase:mainfrom
mehmetkr-31:fix/docker-compose-host-data-dir-default

Conversation

@mehmetkr-31
Copy link
Copy Markdown

Summary

Adds a Compose-level fallback (${HOST_DATA_DIR:-./data}) for the execution service volume mount.

Problem

docker-compose.yml mounts chain data using ${HOST_DATA_DIR}:/data. If HOST_DATA_DIR is unset, Docker Compose expands the variable to an empty string and creates an anonymous volume. This leads to:

  1. Chain data being stored in an opaque Docker-managed location.
  2. Risk of accidental data loss when the volume is pruned.
  3. Confusion for operators who expected data to persist to a local directory.

Solution

Use ${HOST_DATA_DIR:-./data} so that ./data is used as a safe fallback when the variable is missing. This aligns with the default already documented in .env.mainnet and .env.sepolia.

Impact

  • Chain data is always persisted to a predictable local directory.
  • No breaking change for operators who already set HOST_DATA_DIR.

Checklist

  • Change is minimal and focused.
  • Follows the same fallback pattern used elsewhere (e.g., ${NETWORK_ENV:-.env.mainnet}).
  • No breaking changes.

If HOST_DATA_DIR is unset, Docker Compose mounts an empty path,
creating an anonymous volume that is difficult to locate and easy to
accidentally prune. Add a Compose-level fallback of ./data so that
chain data is always persisted to a predictable local directory,
even when the env variable is missing.
@cb-heimdall
Copy link
Copy Markdown
Collaborator

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

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.

2 participants