POSTGRES: FATAL: role "postgres" does not exist

for my django project i wrote a docker-compose.yml, Dockerfile file and a build_dev.sh script after going through various reference and guides.

after the build is complete i can access the hello world page by going to the url http://0.0.0.0/

Now I want to create the database i the running docker container

docker exec -it django_docker_db_1 bash using this command i get access into the db container
then i run the command su - postgres Now when i try to run createuser --createdb --password myproject it asks for a password. I entered the same password that i defined the script (in the guide it was written "When asked, enter the same password for the database as in
the build_dev.sh script.") , but it throws me an error saying createuser: error: could not connect to database postgres: FATAL: role "postgres" does not exist.

please help me with this!

build_dev.sh

#!/usr/bin/env bash

DJANGO_SETTINGS_MODULE="myproject.settings.dev" 
DJANGO_SECRET_KEY="3!^3%bro*!)=1s_g49eqb5&q^4*-m^7p_)q7xkond_b6*lc&&6" 
DATABASE_NAME="myproject" 
DATABASE_USER="myproject" 
DATABASE_PASSWORD="testpassword" 
EMAIL_HOST="localhost" 
EMAIL_PORT="25" 
EMAIL_HOST_USER="" 
EMAIL_HOST_PASSWORD="" 
PIP_REQUIREMENTS="dev.txt" 
docker-compose up --detach --build

docker-compose.yml

version: "3.7"

services:
  nginx:
    image: nginx:latest
    ports:
      - "80:80"
    volumes:
      - ./config/nginx/conf.d:/etc/nginx/conf.d
      - static_volume:/home/myproject/static
      - media_volume:/home/myproject/media
    depends_on:
      - gunicorn

  gunicorn:
    build:
      context: .
      args:
        PIP_REQUIREMENTS: "${PIP_REQUIREMENTS}"
    command: bash -c "/home/myproject/env/bin/gunicorn --workers 3 --bind 0.0.0.0:8000 myproject.wsgi:application"
    depends_on:
      - db
    volumes:
      - static_volume:/home/myproject/static
      - media_volume:/home/myproject/media
    expose:
      - "8000"
    environment:
      DJANGO_SETTINGS_MODULE: "${DJANGO_SETTINGS_MODULE}"
      DJANGO_SECRET_KEY: "${DJANGO_SECRET_KEY}"
      DATABASE_NAME: "${DATABASE_NAME}"
      DATABASE_USER: "${DATABASE_USER}"
      DATABASE_PASSWORD: "${DATABASE_PASSWORD}"
      EMAIL_HOST: "${EMAIL_HOST}"
      EMAIL_PORT: "${EMAIL_PORT}"
      EMAIL_HOST_USER: "${EMAIL_HOST_USER}"
      EMAIL_HOST_PASSWORD: "${EMAIL_HOST_PASSWORD}"

  db:
    image: postgres:latest
    restart: always
    environment:
      POSTGRES_DB: "${DATABASE_NAME}"
      POSTGRES_USER: "${DATABASE_USER}"
      POSTGRES_PASSWORD: "${DATABASE_PASSWORD}"
    ports:
      - 5432
    volumes:
      - postgres_data:/var/lib/postgresql/data/

volumes:
  postgres_data:
  static_volume:
  media_volume:

Dockerfile

# pull official base image
FROM python:3.8

# accept arguments
ARG PIP_REQUIREMENTS=production.txt

# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# install dependencies
RUN pip install --upgrade pip setuptools

# create user for the Django project
RUN useradd -ms /bin/bash myproject

# set current user
USER myproject

# set work directory
WORKDIR /home/myproject

# create and activate virtual environment
RUN python3 -m venv env

# copy and install pip requirements
COPY --chown=myproject ./src/myproject/requirements /home/myproject/requirements/
RUN ./env/bin/pip3 install -r /home/myproject/requirements/${PIP_REQUIREMENTS}

# copy Django project files
COPY --chown=myproject ./src/myproject /home/myproject/

Source: Docker Questions