Skip to content

Instantly share code, notes, and snippets.


den neo0910

View GitHub Profile
neo0910 / docker-compose.yml
Created March 28, 2020 22:54
Docker compose file for the mongo container
View docker-compose.yml
version: '3.7'
container_name: [name]
image: mongo
restart: unless-stopped
- 27017:27017
neo0910 / enter to container
Created March 28, 2020 22:51
How to enter to running docker container
View enter to container
docker exec -it [container-id] bash
View create sql dump from container
docker exec -i your_container mysqldump -uyour_user -pyour_password --databases database_name --skip-comments > /path/to/my/dump.sql
neo0910 / start local mongo container
Last active March 28, 2020 22:56
Run local mongo docker container
View start local mongo container
docker run -d --name [name] -p 27017:27017 mongo
View start mysql docker container
// set password
docker run -d --name yourcustomname -p 3306:3306 -e MYSQL_ROOT_PASSWORD=secret -e MYSQL_DATABASE=mySchema mysql:5.7
// or without password
docker run -d --name yourcustomname -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -e MYSQL_DATABASE=mySchema mysql:5.7