version: '3' services: db: container_name: docker-local-mysql image: mysql:5.7.21 volumes: - "./data:/var/lib/mysql" restart: always ports: - 3306:3306 environment: MYSQL_ROOT_PASSWORD: root