Can't rebuild app 'bundle exec rake db:migrate' failed

During the great effort, I realized that the project needs a PG version 10, and the version that it installs is version 9.5.
The following report is from the PG inside the container

2018-07-27 08:49:27.569 UTC [2144] HINT:  You might need to initdb.
2018-07-27 08:49:28.583 UTC [2146] FATAL:  "/shared/postgres_data" is not a valid data directory
2018-07-27 08:49:28.583 UTC [2146] DETAIL:  File "/shared/postgres_data/PG_VERSION" does not contain valid data.
2018-07-27 08:49:28.583 UTC [2146] HINT:  You might need to initdb.

How can I run the project inside the container manually?
thanks