run mysql with docker-compose

mysql.yml

version: '3'
services:
  mysql:
    image: mysql
    restart: always
    container_name: mysql
    environment:
      MYSQL_ROOT_PASSWORD: "password"
    volumes:
      - /opt/docker/mysql:/var/lib/mysql
    ports:
      - 3306:3306

start : docker-compose -f mysql.yml up -d
stop : docker-compose -f mysql.yml down

Published by

Leave a Reply

Your email address will not be published. Required fields are marked *