Skip to content

fix: restore ../../sql mount path in single-node docker-compose so Postgres init scripts run#4391

Open
mengw15 wants to merge 5 commits intomainfrom
meng-fix-single-node-sql-path
Open

fix: restore ../../sql mount path in single-node docker-compose so Postgres init scripts run#4391
mengw15 wants to merge 5 commits intomainfrom
meng-fix-single-node-sql-path

Conversation

@mengw15
Copy link
Copy Markdown
Contributor

@mengw15 mengw15 commented Apr 15, 2026

What changes were proposed in this PR?

Restore the Postgres init-script volume mount in bin/single-node/docker-compose.yml from ./sql back to ../../sql

Any related issues, documentation, discussions?

close #4390

How was this PR tested?

manually

Was this PR authored or co-authored using generative AI tooling?

no

@mengw15 mengw15 self-assigned this Apr 15, 2026
@github-actions github-actions bot added the build label Apr 15, 2026
@mengw15 mengw15 changed the title restore ../../sql mount path in single-node docker-compose so Postgres init scripts run bug: restore ../../sql mount path in single-node docker-compose so Postgres init scripts run Apr 15, 2026
@mengw15 mengw15 changed the title bug: restore ../../sql mount path in single-node docker-compose so Postgres init scripts run fix: restore ../../sql mount path in single-node docker-compose so Postgres init scripts run Apr 15, 2026
@mengw15 mengw15 requested a review from bobbai00 April 15, 2026 23:09
@bobbai00
Copy link
Copy Markdown
Contributor

Can you try to create a symlink under bin/single-node pointing to sql/ at the root ? Basically mimic what bin/k8s/files did?

@mengw15
Copy link
Copy Markdown
Contributor Author

mengw15 commented Apr 16, 2026

Can you try to create a symlink under bin/single-node pointing to sql/ at the root ? Basically mimic what bin/k8s/files did?

Currently, in .github/workflows/create-release-candidate.yml
line 160-162

# Patch the SQL mount path for the self-contained bundle layout
# In the repo it's ../../sql (relative to bin/single-node/), in the bundle it's ./sql
sed -i 's|../../sql|./sql|g' "$BUNDLE_DIR/docker-compose.yml"

we sed ../../sql with ./sql

if we mimic the bin/k8s/files, we may need to adjust here as well

@bobbai00
Copy link
Copy Markdown
Contributor

Can you try to create a symlink under bin/single-node pointing to sql/ at the root ? Basically mimic what bin/k8s/files did?

Currently, in .github/workflows/create-release-candidate.yml line 160-162

# Patch the SQL mount path for the self-contained bundle layout # In the repo it's ../../sql (relative to bin/single-node/), in the bundle it's ./sql sed -i 's|../../sql|./sql|g' "$BUNDLE_DIR/docker-compose.yml"

we sed ../../sql with ./sql

if we mimic the bin/k8s/files, we may need to adjust here as well

sure, you may adjust the CI as well. I feel '../../sql' should be avoided. Please try the symlink way and see if it works.

@mengw15
Copy link
Copy Markdown
Contributor Author

mengw15 commented Apr 16, 2026

sure, you may adjust the CI as well. I feel '../../sql' should be avoided. Please try the symlink way and see if it works.

I tested this by running docker compose up under bin/single-node, but this symlink way seems doesn't work. The reason could be Docker bind mounts preserve symlinks as-is rather than resolving them. Inside the container, the symlink target ../../../sql/xxx.sql resolves against the container's filesystem.

I remember we were using '../../sql' in the past

@bobbai00
Copy link
Copy Markdown
Contributor

sure, you may adjust the CI as well. I feel '../../sql' should be avoided. Please try the symlink way and see if it works.

I tested this by running docker compose up under bin/single-node, but this symlink way seems doesn't work. The reason could be Docker bind mounts preserve symlinks as-is rather than resolving them. Inside the container, the symlink target ../../../sql/xxx.sql resolves against the container's filesystem.

I remember we were using '../../sql' in the past

Try: docker compose -f bin/single-node --project-directory . --env-file bin/single-node/.env up

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

single-node docker compose up fails — Postgres init scripts not executed due to wrong SQL mount path

2 participants