dz论坛安装

Administrator 238 2022-03-17

dz论坛 docker-compose搭建

version: "3"
services:
    discuz:
      build: .
      image: discuz:3.4
      ports:
        - "88:80"
      restart: always
      volumes:
        - ./upload:/var/www/html
      depends_on:
        - mysql
      networks:
        - webnet
    mysql:
      image: mysql
      command: --default-authentication-plugin=mysql_native_password
      environment:
        - MYSQL_ROOT_PASSWORD=discuz@rockst.cn
      volumes:
        - ./runtime/mysql:/var/lib/mysql
      ports:
        - "13306:3306"
      restart: always
      networks:
        - webnet
networks:
    webnet:

Dockerfile:

FROM php:apache-stretch
MAINTAINER tanbaobao 2360415871@qq.com
COPY ./upload/ /var/www/html
RUN cd /usr/local/bin \
    && ./docker-php-ext-install pdo_mysql \
    && ./docker-php-ext-install mysqli \
    && cd /var/www/html/ \
    && chmod a+w -R config data uc_server/data uc_client/data \
    && rm -rf /var/lib/apt/lists/*
EXPOSE 80

然后从官网下载dz论坛存放在同一目录下,执行docker-compose up -d即可