remove setup.sh script
The setup.sh
file in backend/database/setup
prevents the docker container used during development to start.
- first because, on MacOS at least, a
chmod +x
is necessary to make the file executable. - second because, even when executable, the script expects an environment variable, that is useless for development and doesn't exist. Even with the environment variable set, The script does:
rare-basket-postgres | /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/setup.sh
rare-basket-postgres | Enter password for new role:
rare-basket-postgres | Enter it again:
rare-basket-postgres | SELECT pg_catalog.set_config('search_path', '', false)
rare-basket-postgres | NOTICE: empty string is not a valid password, clearing password
rare-basket-postgres | CREATE ROLE rarebasket_dev PASSWORD 'md55321bf328c21de137e9e01383241bcf7' NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;
i.e. the password is autogenerated and thus unusable in the code, since it is unknown before the script runs.
I guess this script is somehow executed manually when deploying the application, but the directory backend/database/setup
is not supposed to host deployment-related scripts. It's only purpose is to configure the docker container used during development. So this file should be deleted, or moved elsewhere if it has a purpose.