Skip to content

Instantly share code, notes, and snippets.

@oliveira-andre
Last active October 24, 2019 14:24
Show Gist options
  • Select an option

  • Save oliveira-andre/548cbd151cd7cb8206a41b7ddc20172f to your computer and use it in GitHub Desktop.

Select an option

Save oliveira-andre/548cbd151cd7cb8206a41b7ddc20172f to your computer and use it in GitHub Desktop.
containers docker rails and mariadb
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