Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Compose cannot initiate DB container #129

Open
Atsilut opened this issue Oct 11, 2024 · 4 comments
Open

Docker Compose cannot initiate DB container #129

Atsilut opened this issue Oct 11, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Atsilut
Copy link

Atsilut commented Oct 11, 2024

Description:
I cloned main branch and configured all db connection settings, still can't make tables in DB container
So I figured out tables are supposed to be made, but they weren't.
I think /docker/init/setup.sh has wrong direction to init.sql. (I checked files directory in db container and find this problem)
Or maybe I'm just an idiot.

Reproduction Steps:
Fix INIT bash script (/docker/init/setup.sh)
from
$ pg_restore --username="$POSTGRES_USER" --dbname="$POSTGRES_DB" --verbose /schemas/init.sql
to
$ pg_restore --username="$POSTGRES_USER" --dbname="$POSTGRES_DB" --verbose ./schemas/init.sql

Screenshots

Additional context

@Atsilut Atsilut added the bug Something isn't working label Oct 11, 2024
@stratic-dev
Copy link
Contributor

You're setup.sh is saved as CRLF it needs to be saved as LF.

@stratic-dev
Copy link
Contributor

Open in VSCODE or something look in the bottom right corner and click where it says CRLF and then change it to LF
image

@Atsilut
Copy link
Author

Atsilut commented Oct 12, 2024

123
I already read that problem in README.MD and my script file is actually fine with that
and yet, works well when I correct the directory

@Atsilut
Copy link
Author

Atsilut commented Oct 12, 2024

1234
See the docker db container's file directory. setup.sh cannot find init.sql with your coded path.
Because there is no schemas folder nor init.sql in docker-entrypoint-initdb.d.
So it should go back and find /schemas/ directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants