docker 快速搭建 WordPress

安装Docker

环境:阿里云服务器 

镜像:CentOs 7.4 64

https://docs.docker.com/install/linux/docker-ce/centos/ 

 

version: '3.1'

services:

  wordpress:
    image: wordpress
    restart: always
    ports:
      - 8080:80
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_USER: exampleuser
      WORDPRESS_DB_PASSWORD: examplepass
      WORDPRESS_DB_NAME: exampledb

  db:
    image: mysql:5.7
    restart: always
    environment:
      MYSQL_DATABASE: exampledb
      MYSQL_USER: exampleuser
      MYSQL_PASSWORD: examplepass
      MYSQL_RANDOM_ROOT_PASSWORD: '1'

docker-compose -f stack.yml up

posted @ 2018-03-06 15:21  那个汪  阅读(115)  评论(0编辑  收藏  举报