docker
#########################################
# Docker #
#########################################
alias dc="docker-compose"
# Interact with WP-CLI in Docker container
alias dockwp="docker-compose exec --user www-data phpfpm wp"
# SSH in to Docker container
alias dockroot="docker-compose exec --user root phpfpm bash"
alias dockbash='docker-compose exec --user www-data phpfpm bash'
docker ps
docker ps -a
docker container ls
docker container ls -a
docker stop $(docker ps -aq)
docker rm $(docker ps -aq)
====================================
Not Docker related, but help see what processes (if any) are running on port 3306
lsof -i:3306
#########################################
# Docker #
#########################################
# Stop all docker containers
dockerstop() {
docker stop $(docker ps -aq) && docker rm $(docker ps -aq);
}
# Stop all docker containers anywhere and start from the folder
dockerstart() {
dockerstop; dc up -d;
}
# Create a new project with WP Local Docker
wp-docker() {
git clone git@github.com:10up/wp-local-docker.git "$1";
cd $1;
docker-compose up -d;
}