Skip to content

Instantly share code, notes, and snippets.

Avatar
🗿

den neo0910

🗿
View GitHub Profile
@neo0910
neo0910 / docker-compose.yml
Created Mar 28, 2020
Docker compose file for the mongo container
View docker-compose.yml
version: '3.7'
services:
database:
container_name: [name]
image: mongo
restart: unless-stopped
ports:
- 27017:27017
@neo0910
neo0910 / enter to container
Created Mar 28, 2020
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
neo0910 / start local mongo container
Last active Mar 28, 2020
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