Skip to content

Instantly share code, notes, and snippets.

@ivanmonteiro
Last active October 9, 2019 23:29
Show Gist options
  • Select an option

  • Save ivanmonteiro/5ce1783a03f990d1ede63e8b59641d19 to your computer and use it in GitHub Desktop.

Select an option

Save ivanmonteiro/5ce1783a03f990d1ede63e8b59641d19 to your computer and use it in GitHub Desktop.
Mysql 5.7 docker with data volume, restart unless stopeed and custom config
docker run --name mysql --env-file /home/ubuntu/mysql-env/.env -v /home/ubuntu/mysql-data:/var/lib/mysql -v /home/ubuntu/mysql-config/my.cnf:/etc/my.cnf -p 3306:3306 -d --restart unless-stopped mysql:5.7
@ivanmonteiro
Copy link
Author

.env file contents:
MYSQL_ROOT_PASSWORD=
MYSQL_DATABASE=
MYSQL_USER=
MYSQL_PASSWORD=

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment