docker-compose.yml (Código)

version: '3'
services:
  db:
    image: mysql:8.0.21
    # image: mysql:5.7.31
    container_name: MySQL
    restart: on-failure
    ports:
      - '3306:3306'
    volumes:
      - /etc/localtime:/etc/localtime:ro
      # - mysql-data:/var/lib/mysql
      # - ./data/db:/var/lib/mysql
    environment:
      MYSQL_USER: dbuser
      MYSQL_PASSWORD: 123456
      MYSQL_ROOT_PASSWORD: 123456
      MYSQL_DATABASE: database_name
    # devices:
    #   - "/dev/ttyUSB0:/dev/ttyUSB0"
# volumes:
#   mysql-data: