Erupe icon indicating copy to clipboard operation
Erupe copied to clipboard

Docker Compose cannot initiate DB container

Open Atsilut opened this issue 1 year ago • 4 comments

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 avatar Oct 11 '24 11:10 Atsilut

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

stratic-dev avatar Oct 11 '24 17:10 stratic-dev

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

stratic-dev avatar Oct 11 '24 17:10 stratic-dev

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 avatar Oct 12 '24 09:10 Atsilut

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

Atsilut avatar Oct 12 '24 09:10 Atsilut