Skip to content

Instantly share code, notes, and snippets.

@DaysJan
Created March 5, 2019 02:47
Show Gist options
  • Select an option

  • Save DaysJan/b92a1a67a11b5c2af97b8a48893d99bd to your computer and use it in GitHub Desktop.

Select an option

Save DaysJan/b92a1a67a11b5c2af97b8a48893d99bd to your computer and use it in GitHub Desktop.

Revisions

  1. DaysJan created this gist Mar 5, 2019.
    9 changes: 9 additions & 0 deletions run-db-docker.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    #!/bin/bash

    mkdir -p /data/mysql /data/redis

    # mysql
    docker run --name mysql -e MYSQL_ROOT_PASSWORD=123456 -p 3306:3306 -v /data/mysql:/var/lib/mysql -d --restart unless-stopped mysql:5.7 --general-log=1 --general_log_file=general.log

    # redis
    docker run --name redis -p 6379:6379 -v /data/redis:/data -d --restart unless-stopped redis:4.0-alpine redis-server --appendonly yes