gitlab-ce docker – "PG::ConnectionBad: could not connect to server: No such file or directory"

I’ve been using gitlab-ce for some time and now after updating it by running docker-compose pull it fails to start with this error.

git_1          | Recipe: gitlab::database_migrations
git_1          |   * bash[migrate gitlab-rails database] action run
git_1          |     [execute] rake aborted!
git_1          |               PG::ConnectionBad: could not connect to server: No such file or directory
git_1          |                Is the server running locally and accepting
git_1          |                connections on Unix domain socket "/var/opt/gitlab/postgresql/.s.PGSQL.5432"?
git_1          |               /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:48:in `block (3 levels) in <top (required)>'
git_1          |               /opt/gitlab/embedded/bin/bundle:23:in `load'
git_1          |               /opt/gitlab/embedded/bin/bundle:23:in `<main>'
git_1          |               Tasks: TOP => gitlab:db:configure
git_1          |               (See full trace by running task with --trace)
git_1          |     
git_1          |     ================================================================================
git_1          |     Error executing action `run` on resource 'bash[migrate gitlab-rails database]'
git_1          |     ================================================================================
git_1          |     
git_1          |     Mixlib::ShellOut::ShellCommandFailed
git_1          |     ------------------------------------
git_1          |     Expected process to exit with [0], but received '1'
git_1          |     ---- Begin output of "bash"  "/tmp/chef-script20200629-25-idzu10" ----
git_1          |     STDOUT: rake aborted!
git_1          |     PG::ConnectionBad: could not connect to server: No such file or directory
git_1          |        Is the server running locally and accepting
git_1          |        connections on Unix domain socket "/var/opt/gitlab/postgresql/.s.PGSQL.5432"?
git_1          |     /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:48:in `block (3 levels) in <top (required)>'
git_1          |     /opt/gitlab/embedded/bin/bundle:23:in `load'
git_1          |     /opt/gitlab/embedded/bin/bundle:23:in `<main>'
git_1          |     Tasks: TOP => gitlab:db:configure
git_1          |     (See full trace by running task with --trace)
git_1          |     STDERR: 
git_1          |     ---- End output of "bash"  "/tmp/chef-script20200629-25-idzu10" ----
git_1          |     Ran "bash"  "/tmp/chef-script20200629-25-idzu10" returned 1
git_1          |     

There is no postresql in my docker-compose – there never was and it was fine.

In postresql log that was in docker/git files i have found this:

FATAL: database files are incompatible with server 
DETAIL: The data directory was initialized by PostgreSQL version 10, which is not compatible with this version 11.7. docker-ce

How can i migrate git data to new version of postresql?
Is it really part of update gitlab-ce process? Usually it was only docker pull and it was working fine.

Source: StackOverflow