SHARE
TWEET

Untitled

a guest Apr 2nd, 2019 38 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Wordpress & Docker
  2.  
  3. This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command
  4.  
  5. ```
  6. $ docker-compose up -d
  7.  
  8. # To Tear Down
  9. $ docker-compose down --volumes
  10. ```
  11.  
  12. ```
  13. version: '3'
  14.  
  15. services:
  16.   # Database
  17.   db:
  18.     image: mysql:5.7
  19.     volumes:
  20.       - db_data:/var/lib/mysql
  21.     restart: always
  22.     environment:
  23.       MYSQL_ROOT_PASSWORD: password
  24.       MYSQL_DATABASE: wordpress
  25.       MYSQL_USER: wordpress
  26.       MYSQL_PASSWORD: wordpress
  27.     networks:
  28.       - wpsite
  29.   # phpmyadmin
  30.   phpmyadmin:
  31.     depends_on:
  32.       - db
  33.     image: phpmyadmin/phpmyadmin
  34.     restart: always
  35.     ports:
  36.       - '8080:80'
  37.     environment:
  38.       PMA_HOST: db
  39.       MYSQL_ROOT_PASSWORD: password
  40.     networks:
  41.       - wpsite
  42.   # Wordpress
  43.   wordpress:
  44.     depends_on:
  45.       - db
  46.     image: wordpress:latest
  47.     ports:
  48.       - '8000:80'
  49.     restart: always
  50.     volumes: ['./:/var/www/html']
  51.     environment:
  52.       WORDPRESS_DB_HOST: db:3306
  53.       WORDPRESS_DB_USER: wordpress
  54.       WORDPRESS_DB_PASSWORD: wordpress
  55.     networks:
  56.       - wpsite
  57. networks:
  58.   wpsite:
  59. volumes:
  60.   db_data:
  61. ```
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top