Advertisement
CristianCantoro

docker_compose_volumes

May 25th, 2019
453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.64 KB | None | 0 0
  1. version: '3.3'
  2.  
  3. services:
  4.    db:
  5.      image: mysql:5.7
  6.      volumes:
  7.       - db_data:/var/lib/mysql
  8.      restart: always
  9.      environment:
  10.        MYSQL_ROOT_PASSWORD: somewordpress
  11.        MYSQL_DATABASE: wordpress
  12.        MYSQL_USER: wordpress
  13.        MYSQL_PASSWORD: wordpress
  14.  
  15.    wordpress:
  16.      depends_on:
  17.       - db
  18.      image: wordpress:latest
  19.      volumes:
  20.       - wp_data:/var/www/html
  21.      ports:
  22.       - "8000:80"
  23.      restart: always
  24.      environment:
  25.        WORDPRESS_DB_HOST: db:3306
  26.        WORDPRESS_DB_USER: wordpress
  27.        WORDPRESS_DB_PASSWORD: wordpress
  28.        WORDPRESS_DB_NAME: wordpress
  29. volumes:
  30.     db_data: {}
  31.     wp_data: {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement