daily pastebin goal
18%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 108 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.       - '8081: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.   cadvisor:
  58.     container_name: cadvisor
  59.     image: google/cadvisor
  60.     volumes:
  61.       - /:/rootfs:ro
  62.       - /var/run:/var/run:rw
  63.       - /sys:/sys:ro
  64.       - /var/lib/docker/:/var/lib/docker:ro
  65.     ports:
  66.       - "8080:8080"
  67.     networks:
  68.       - wpsite
  69.     depends_on:
  70.       - db
  71.   prometheus:
  72.     image: prom/prometheus:latest
  73.     container_name: prometheus
  74.     ports:
  75.       - 9090:9090
  76.     command:
  77.       - --config.file=/etc/prometheus/prometheus.yml
  78.     volumes:
  79.       - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
  80.     depends_on:
  81.       - cadvisor
  82.     networks:
  83.       - wpsite
  84. networks:
  85.   wpsite:
  86.     driver: bridge
  87. volumes:
  88.   db_data:
  89. ```
  90.  
  91. prometheus.yml
  92. ```
  93. scrape_configs:
  94. - job_name: cadvisor
  95.   scrape_interval: 5s
  96.   static_configs:
  97.   - targets:
  98.     - cadvisor:8080
  99. ```
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