How to create docker images and run it in an EC2?

I’m very much new to the Docker world. I have a docker-compose file which works fine for me.
But how do I create these Docker images and run it in an EC2.
Any help would be appreciated.
PS: I don’t want to use ECS or ECR for this. I hope DockerHub should work fine for storing and retrieving these images (Correct me if I’m wrong).

Thanks.

version: "3"
services:
  app:
    image: node:12.13.1
    volumes:
      - ./:/app
    working_dir: /app
    depends_on:
      - mongo
      - nats
    environment:
      NODE_ENV: development
    ports:
      - 3000:3000
    command: npm run dev
  app_2:
    image: node:12.13.1
    volumes:
      - ../app_2/:/app
    working_dir: /app_2
    depends_on:
      - mongo
      - nats
    links:
      - mongo
    environment:
      NODE_ENV: development
    ports:
      - 4000:4000
    command: npm run dev
  mongo:
    image: mongo
    expose:
      - 27017
    ports:
      - "27017:27017"
    volumes:
      - ./data/db:/data/db
  nats:
    image: 'nats:2.1.2'
    expose:
      - "4222"
    ports:
      - "8222:8222"
    hostname: nats-server

Source: StackOverflow