修的了电脑 敲得了代码
     写得了前端 稳得住后端

docker-compose部署WordPress,MySQL,Nginx的具体yaml文件,可指定版本

version: "3"
services:
  nginx:
    image: nginx:latest
    ports:
        - 8080:80
    volumes:
        - ./code:/code
        - ./site.conf:/etc/nginx/conf.d/site.conf
    links:
        - php
  php:
    image: php:7-fpm
    volumes:
        - ./code:/code
  db:
    container_name: mysql
    image: mysql:8.0
    command:
      - --default_authentication_plugin=mysql_native_password
      - --character-set-server=utf8mb4
      - --collation-server=utf8mb4_unicode_ci
    volumes:
      - ./data:/var/lib/mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: 123456
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: 123456
  wordpress:
    container_name: wordpress
    depends_on:
      - db
    image: wordpress:latest
    ports:
      - "8000:80"
    restart: always
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_NAME: wordpress
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: 123456
    volumes:
      - ./html:/var/www/html
      - ./config/upload.ini:/usr/local/etc/php/conf.d/upload.ini
volumes:
  db_data:
  wordpress:

赞(7)
未经允许不得转载:流云溪|码农 » docker-compose部署WordPress,MySQL,Nginx的具体yaml文件,可指定版本