Last active
October 24, 2019 14:24
-
-
Save oliveira-andre/548cbd151cd7cb8206a41b7ddc20172f to your computer and use it in GitHub Desktop.
containers docker rails and mariadb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get install libmysqlclient-dev | |
| docker network create rede_docker | |
| docker pull mariadb | |
| docker run -d \ | |
| --name=mariadb \ | |
| --restart=always \ | |
| --network=rede_docker \ | |
| -v /etc/localtime:/etc/localtime:ro \ | |
| -u root \ | |
| -e MYSQL_ROOT_PASSWORD=root \ | |
| -v /storage/mariadb:/var/lib/mysql \ | |
| -p 3306:3306 \ | |
| mariadb:latest | |
| ## call host:"mariadb" in database.yml | |
| docker pull ruby | |
| ##you can also use my dockerfile in my gist | |
| docker build -t rails . | |
| docker run -it --rm rails rails db:create | |
| docker run -it --rm rails rails db:migrate | |
| docker run -d -p 3000:3000 --network=rede rails |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment