Keeping the content of a folder after bind mount

Kind of, but not really. You can create a named volume backed by a bind. When the volume is empty, it will copy the original content from the container path into the volume, before binding it into the container path. This is a one time thing! So if you choose to delete, change or add new files in your image, this mechanism will not copy them back to the volume.

You can create a named volume backed by a bind like this:

volumes:
  mybindvolume:
    driver: local
    driver_opts:
      type: none
      o: bind
      device: /host/path

From my perspective, it is bad image design to depend on that mechanism.

Instead, store your files in a different location, and create an entrypoint script that copies the files into the target location. This way you can handle if and how you want to copy new files to the target location.

Note: a bind or a named volume will always eclipse the original content of the container folder, so the original content can’t be seen or accessed anymore.