<jupyter_start><jupyter_text>"Docker"> Docker commands- toc: false- branch: master- categories: [code snippets, docker] **Stop all containers**<jupyter_code>docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)<jupyter_output><empty_output><jupyter_text>**Remove all images**<jupyter_code>docker system prune -a<jupyter_output><empty_output><jupyter_text>**Stop docker-compose and remove volumes**<jupyter_code>docker-compose down -v<jupyter_output><empty_output><jupyter_text>**Run Docker container for data science workflows**<jupyter_code>docker run -d \
    -v "${PWD}:/workspace" \
    -p 8080:8080 \
    --name "ml-workspace" \
    --env AUTHENTICATE_VIA_JUPYTER="mytoken" \
    --shm-size 2g \
    --restart always \
    dagshub/ml-workspace:latest<jupyter_output><empty_output><jupyter_text>**Run wordpress, mysql & phpmyadmin with docker-compose**<jupyter_code>version: "3.3"

services:
  db:
    image: mysql:5.7
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: <PASSWORD>
    volumes:
      - ./db_volume:/var/lib/mysql
    networks:
      - wpsite

  phpmyadmin:
    depends_on:
      - db
    image: phpmyadmin/phpmyadmin
    restart: always
    ports:
      - '8080:80'
    environment:
      PMA_HOST: db
      MYSQL_ROOT_PASSWORD: password 
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: <PASSWORD>
    networks:
      - wpsite

  wordpress:
    depends_on:
      - db
    image: wordpress:latest
    ports:
      - "8000:80"
    restart: always
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: <PASSWORD>
      WORDPRESS_DB_NAME: wordpress
    volumes:
      - ./wp_volume:/var/www/html
      - ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
    networks:
      - wpsite

networks:
  wpsite:<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11336453458138325, 'fraction_numerical': 0.015080603224128965, 'mean_word_length': 3.1917211328976034, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '619432', 'license': 'Apache-2.0', 'n_tokens_mistral': 737, 'n_tokens_neox': 706, 'n_words': 127, 'path': '_notebooks/2020-08-16-docker.ipynb', 'repo_name': 'fabge/snippets', 'size': '1920'}