利用docker-compose搭建WorldPress博客系统

发布于 2022-02-22  1747 次阅读


  1. 文件名为docker-compose.yml
  2. version: '2'

    services:
    db:
    image : mysql:5.7
    volumes:
    - "./.data/db:/var/lib/mysql"
    restart : always
    environment:
    MYSQL_ROOT_PASSWORD :
    MYSQL_DATABASE : wordpress
    MYSQL_USER : wordpress
    MYSQL_PASSWORD :

    wordpress:
    depends_on:
    - db
    image: wordpress:latest
    links:
    - db
    ports:
    - "8000:80"
    restart : always
    environment:
    WORDPRESS_DB_HOST:db : 3306
    WORDPRESS_DB_PASSWORD : wordpress
    ~

  3. docker-compose up -d
  4. 访问ip:8000
    参考
子夜不哭
最后更新于 2022-02-22