Skip to content

簡介

docker-compose up mysql

內容

version: "3"
services:

  db:
    image: mysql:5.7
    ports:
      - "33060:3306"
    volumes:
      - ./data:/var/lib/mysql
    restart: always
    environment:
      - MYSQL_USER=tommy
      - MYSQL_PASSWORD=tommy
      - MYSQL_DATABASE=dockerDb
      - MYSQL_ROOT_PASSWORD=root

參考資料