Как в docker-compose прописать импорт БД?
Папка docker-entrypoint-initdb.d

https://hub.docker.com/_/mysql
When a container is started for the first time, a new database with the specified name will be created and initialized with the provided configuration variables. Furthermore, it will execute files with extensions .sh, .sql and .sql.gz that are found in /docker-entrypoint-initdb.d. Files will be executed in alphabetical order. You can easily populate your mysql services by mounting a SQL dump into that directory and provide custom images with contributed data. SQL files will be imported by default to the database specified by the MYSQL_DATABASE variable.
Проблема решена благодаря комментариям, спасибо! Оставлю если кому понадобится настройки сервиса db в компосе:
db:
    command: mkdir db
    image: mysql:5.7
    container_name: mysql-db
    command: --default-authentication-plugin=mysql_native_password
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: "super_pass_root"
      MYSQL_DATABASE: "db__docker"
      MYSQL_USER: "user"
      MYSQL_PASSWORD: "super_pass_for_user"
    ports:
      - 3318:3306
    volumes:
      - ./db:/var/lib/mysql
      - ./file_setting/init.sql:/docker-entrypoint-initdb.d/init.sql
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
Здесь в коде: каталог "file_setting" хранит файл "init.sql", который был заранее туда положен.