Create a postgres database in my Dockerfile

in my project i have a docker-compose.yml file like this:

version: '3'

networks:
  mynetwork:
    driver: bridge

services:

  postgres:
    restart: always
    image: postgres:11
    ports:
      - "5432:5432"
    healthcheck:
        test: ["CMD", "curl", "-f", "http://localhost:5432"]
        interval: 30s
        timeout: 10s
        retries: 5
    volumes:
      - ./data:/var/lib/postgresql/data

  web:
    build: .
    image: <myrepo>/<mypath>
    command: python /Code/core/manage.py runserver 0.0.0.0:8000
    networks:
      - mynetwork

    ports:
      - "8000:8000"

    depends_on:
      - postgres

Now i would to build my dockerized app as an image using only Dockerfile instead docker compose.
I need a way for create a postgres db image using my docker file like i did with docker-compose.

My actual dockerfile is:

FROM python:3.6-alpine
RUN apk add --no-cache make linux-headers libffi-dev jpeg-dev zlib-dev
RUN apk update && apk add postgresql-dev gcc python3-dev musl-dev
#RUN apk update && apk add build-essential libssl-dev libffi-dev
RUN mkdir /Code
WORKDIR /Code
COPY ./requirements.txt .

RUN pip install --upgrade pip
RUN pip install -r requirements.txt
ENV PYTHONUNBUFFERED 1

COPY . /Code/

ENTRYPOINT python /Code/core/manage.py runserver 0.0.0.0:8000

How can i create and start a postgres db container from Dockerfile?

So many thanks in advance

Source: StackOverflow