自建Docker bbs修罗论坛 xiuno

date
Oct 25, 2022
slug
newservice-bbs-xiuno
status
Published
summary
新服务 论坛
tags
service
type
Post
notion image

Summary

步骤

 
export DOCKER_PROJ=xiuno_ck
mkdir /data/$DOCKER_PROJ; cd /data/$DOCKER_PROJ
git clone https://github.com/wanghaiwei/xiuno-docker.git
cd xiuno-docker
wget https://github.com/jiix/xiunobbs/releases/download/v4.0.7/xiunobbs-v4.0.7.zip
unzip xiunobbs-v4.0.7.zip && mv xiunobbs-4.0.7 xiuno

修改.env

# docker inspect npm_nginx_proxy_manager-network | grep -i Subnet

cp .env.example .env && vi .env

# define env var default value
MYSQL_ROOT_PASSWORD=123456
MYSQL_USER=xiuno
MYSQL_PASSWORD=123456
NGINX_PORT=8018
MYSQL_SERVER_ADDRESS=xiuno-mysql
#MYSQL_SERVER_ADDRESS=10.10.100.1
DOCKER_NET=192.168.80.0/20
#DOCKER_NET=10.10.0.1/16
.env
notion image
notion image

修改 docker-compose.yml

version: '3.4'
services:
    xiuno-nginx:
        build: ./nginx
        image: nginx:volume-fixed-latest
        # 端口映射
        ports:
            - "$NGINX_PORT:80"
        # 依赖关系 先跑php
        depends_on:
            - "xiuno-php-fpm"
        # 数据卷
        volumes:
            - "$PWD/xiuno:/var/www/html"
        links:
            - xiuno-php-fpm
            - xiuno-mysql
        # 容器名称
        container_name: "xiuno-nginx"
    xiuno-php-fpm:
        build: ./php-fpm
        # image指定build Dockerfile生成镜像的名称
        image: php:fpm-mysqli-latest
        expose:
            - "9000"
        volumes:
            - "$PWD/xiuno:/var/www/html"
        container_name: "xiuno-php-fpm"
    xiuno-mysql:
        build: ./mysql
        image: mysql:fixed-auth-latest
        expose:
            - "3306"
        # 环境变量
        environment:
            # mysql密码
            - MYSQL_ROOT_PASSWORD
            - MYSQL_USER
            - MYSQL_PASSWORD
        volumes:
            - "$PWD/mysql/data:/var/lib/mysql"
        container_name: "xiuno-mysql"
networks:
  default:
    name: npm_nginx_proxy_manager-network
    external: true
notion image

修改nginx/default.conf

notion image

修改php-fpm

notion image
notion image
# 如果修改了任何文件,需要rebuild
docker compose build

docker-compose down; docker-compose up -d; sleep 1s; docker-compose logs -f

local cache / cloudflare cache都要关闭,不然安装会有各种问题

CloudFlare设立新的域名

notion image

npm nginx proxy manager配置

notion image
 

优化

打开伪静态

location ~* \.(htm)$ {
    rewrite "^(.*)/(.+?).htm(.*?)$" $1/index.php?$2.htm$3 last;
}
notion image
notion image

不同的前台风格

notion image
notion image
notion image
 

验证

notion image
 
 

© Ying Bun 2021 - 2024