Dev container environment set up

Hi All, I am trying to set up a development environment for an open source project using the instructions provided here. Everything works fine until you try to set up postgreSQL.

The following command

# Database setup
sudo -su postgres createuser $USER --createdb

throws the following error

Sorry, user vscode is not allowed to execute '/usr/bin/createuser vscode --createdb' as postgres on 784f8b65581d.

If I switch to postgress using sudo su postgres and execute createuser $USER --createdb, I am able to create the databases as usual. However, during the final set up, while initializing the database using indico db prepare, I get sqlalchemy.exc.ProgrammingError: (psycopg2.errors.InsufficientPrivilege) permission denied for database indico.

Anyone with experience know how to get this right? Do I have to create a separate docker container for postgres and expose the socket (which does not seem logical)?

The above procedure just works fine on a regular Ubuntu server.