Compare commits

...

7 Commits

Author SHA1 Message Date
90afcb140b 修改docker 2025-10-31 18:03:20 +08:00
c59be26ea3 修改docker 2025-10-31 17:08:27 +08:00
a1788210dc 修改docker 2025-10-31 16:17:15 +08:00
dbb9e8b6d6 修改docker 2025-10-31 13:08:55 +08:00
26c8a54a55 docker 2025-10-31 01:26:32 +08:00
a535ec79b6 docker 2025-10-31 01:21:31 +08:00
9aebd17f1c 调整 2025-08-15 13:55:05 +08:00
48 changed files with 721 additions and 8 deletions

14
.dockerignore Normal file
View File

@ -0,0 +1,14 @@
.git
.gitignore
.env
.DS_Store
*.md
docker-compose.yml
Dockerfile
.dockerignore
node_modules
.vscode
.idea
*.log
runtime/*
*.user.ini

1
.htaccess Normal file
View File

@ -0,0 +1 @@

74
404.html Executable file

File diff suppressed because one or more lines are too long

74
502.html Executable file

File diff suppressed because one or more lines are too long

174
DOCKER_README.md Normal file
View File

@ -0,0 +1,174 @@
# Docker 部署说明
本项目使用 `webdevops/php-nginx:7.2-alpine` 作为基础镜像。
## 文件说明
- `Dockerfile` - Docker 镜像构建文件
- `docker-compose.yml` - Docker Compose 编排文件
- `.dockerignore` - Docker 构建忽略文件
- `docker/nginx/vhost.conf` - Nginx 虚拟主机配置
## 快速启动
### 1. 安装依赖(首次部署)
在启动 Docker 之前,需要先在宿主机上安装 Composer 依赖:
```bash
composer install
```
### 2. 启动服务
```bash
docker-compose up -d
```
### 3. 查看服务状态
```bash
docker-compose ps
```
### 4. 查看日志
```bash
# 查看所有服务日志
docker-compose logs -f
# 查看 web 服务日志
docker-compose logs -f web
# 查看 MySQL 日志
docker-compose logs -f mysql
```
## 服务信息
### Web 服务
- 访问地址: http://localhost:8080
- 容器名称: weipan_web
- PHP 版本: 7.2
- Web 服务器: Nginx
### MySQL 服务
- 主机: mysql (容器内) / localhost:3306 (宿主机)
- 数据库: weipan
- 用户名: weipan
- 密码: weipan123
- Root 密码: root
## 配置说明
### PHP 配置
- 内存限制: 256M
- 执行时间: 300秒
- POST 大小: 50M
- 上传文件大小: 50M
### 数据库配置
修改 `config/database.php` 中的数据库连接信息:
```php
'hostname' => 'mysql', // Docker 容器内使用服务名
'database' => 'weipan',
'username' => 'weipan',
'password' => 'weipan123',
```
## 常用命令
### 停止服务
```bash
docker-compose stop
```
### 重启服务
```bash
docker-compose restart
```
### 停止并删除容器
```bash
docker-compose down
```
### 停止并删除容器和数据卷
```bash
docker-compose down -v
```
### 重新构建镜像
```bash
docker-compose build --no-cache
docker-compose up -d
```
### 进入容器
```bash
# 进入 web 容器
docker-compose exec web sh
# 进入 MySQL 容器
docker-compose exec mysql bash
```
### 清理缓存
```bash
docker-compose exec web php think clear
```
## 目录权限
如果遇到权限问题,可以在容器内执行:
```bash
docker-compose exec web chown -R application:application /app
docker-compose exec web chmod -R 777 /app/runtime
```
## 生产环境建议
1. 修改 MySQL 密码为强密码
2. 调整 `docker-compose.yml` 中的端口映射
3. 设置合适的环境变量
4. 配置数据卷备份策略
5. 启用 HTTPS
6. 配置防火墙规则
## 故障排查
### 查看容器日志
```bash
docker-compose logs -f web
```
### 检查容器状态
```bash
docker-compose ps
```
### 测试数据库连接
```bash
docker-compose exec mysql mysql -uweipan -pweipan123 weipan
```
### 重置权限
```bash
docker-compose exec web chown -R application:application /app
docker-compose exec web chmod -R 755 /app
docker-compose exec web chmod -R 777 /app/runtime
```

39
Dockerfile Normal file
View File

@ -0,0 +1,39 @@
FROM webdevops/php-nginx:7.2-alpine
# 设置工作目录
WORKDIR /app
# 复制项目文件
COPY . /app
# 复制 Nginx 配置文件
COPY docker/nginx/enable-php.conf /opt/docker/etc/nginx/enable-php.conf
COPY docker/nginx/vhost.conf /opt/docker/etc/nginx/vhost.conf
# 复制自定义 entrypoint 脚本
COPY docker/entrypoint.sh /usr/local/bin/custom-entrypoint.sh
# 安装时区数据并给脚本添加可执行权限
RUN apk add --no-cache tzdata && \
chmod +x /app/public/start.sh && \
chmod +x /usr/local/bin/custom-entrypoint.sh
# 设置权限app 目录可写内部文件只读runtime 目录可写
RUN chmod 755 /app && \
chmod -R 555 /app/* && \
chmod -R 755 /app/runtime && \
chmod -R 755 /app/upload
# 复制 crontab 配置并安装
COPY docker/crontab /tmp/crontab
RUN cat /tmp/crontab && \
crontab -u application /tmp/crontab && \
crontab -u application -l && \
rm /tmp/crontab
# 设置环境变量
ENV SERVER_DATE_TIMEZONE=Asia/Shanghai
ENV WEB_DOCUMENT_ROOT=/app/public \
PHP_DISPLAY_ERRORS=0 \
PHP_MEMORY_LIMIT=512M \
PHP_MAX_EXECUTION_TIME=300 \
PHP_POST_MAX_SIZE=50M \
PHP_UPLOAD_MAX_FILESIZE=50M \
PHP_DATE_TIMEZONE=${SERVER_DATE_TIMEZONE}
# 声明容器对外暴露的端口
EXPOSE 80
# 设置自定义 entrypoint
ENTRYPOINT ["/usr/local/bin/custom-entrypoint.sh"]

View File

@ -50,7 +50,7 @@
<th class='text-left nowrap'>当前收益(元)</th>
<th class='text-left nowrap'>预期收益(元)</th>
<th class='text-left nowrap'>开始时间</th>
<th class='text-left nowrap'>结算时间</th>
<!-- <th class='text-left nowrap'>结算时间</th>-->
<th class='text-left nowrap'>结束时间</th>
<th class='text-left nowrap'>状态</th>
<th class='text-left nowrap'></th>
@ -90,9 +90,9 @@
<td class='text-left nowrap'>
{$vo.start_time}
</td>
<td class='text-left nowrap'>
{:date('Y-m-d H:i:s',$vo.profit_time)}
</td>
<!-- <td class='text-left nowrap'>-->
<!-- {:date('Y-m-d H:i:s',$vo.profit_time)}-->
<!-- </td>-->
<td class='text-left nowrap'>
{$vo.end_time}
</td>

View File

@ -13,7 +13,7 @@
// +----------------------------------------------------------------------
return [
// 数据库调试模式
'debug' => env('database.debug', true),
'debug' => false,
// 数据库类型
'type' => 'mysql',
// 服务器地址

31
docker-compose.yml Normal file
View File

@ -0,0 +1,31 @@
version: '3.8'
services:
weipan02:
container_name: weipan02
image: gits.boolcdn.net/weipan_server:25.10.31
environment:
- SERVER_DATE_TIMEZONE=Asia/Shanghai
# 数据库配置(用于生成 .env 文件)
- database_hostname=10.0.0.1
- database_database=0302-2
- database_username=0302-2
- database_password=0302-2
- database_charset=utf8mb4
- database_hostport=3306
ports:
- "8080:80"
volumes:
- /www/docker/weipan02/_runtime:/app/runtime
- /www/docker/weipan02/_upload:/app/public/upload
networks:
- docker
restart: always
deploy:
resources:
limits:
cpus: "0.25"
memory: 8gb
networks:
docker:
external: true

5
docker/crontab Normal file
View File

@ -0,0 +1,5 @@
# 每分钟执行 start.sh
* * * * * /bin/sh /app/public/start.sh >> /app/runtime/log/start_log.log 2>&1
# 每分钟执行 think InterestTreasure
* * * * * cd /app && /usr/local/bin/php /app/think InterestTreasure >> /app/runtime/log/InterestTreasure_log.log 2>&1

28
docker/entrypoint.sh Normal file
View File

@ -0,0 +1,28 @@
#!/bin/sh
set -e
cp /usr/share/zoneinfo/${SERVER_DATE_TIMEZONE:-Asia/Shanghai} /etc/localtime
echo "${SERVER_DATE_TIMEZONE:-Asia/Shanghai}" > /etc/timezone
# 动态设置 PHP_DATE_TIMEZONE 与 SERVER_DATE_TIMEZONE 保持一致(运行时生效)
export PHP_DATE_TIMEZONE=${SERVER_DATE_TIMEZONE:-Asia/Shanghai}
date
# 根据环境变量生成 .env 文件
cat > /app/.env <<EOF
[DATABASE]
HOSTNAME=${database_hostname:-10.100.100.88}
DATABASE=${database_database:-mydatabase}
USERNAME=${database_username:-myuser}
PASSWORD=${database_password:-mypassword}
CHARSET=${database_charset:-utf8mb4}
HOSTPORT=${database_hostport:-3306}
EOF
echo "Generated .env file:"
cat /app/.env
# 执行原始镜像的入口点webdevops 镜像使用 supervisord
exec /entrypoint supervisord

View File

@ -0,0 +1,41 @@
location ~ [^/]\.php(/|$)
{
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REQUEST_SCHEME $scheme;
fastcgi_param HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
}

52
docker/nginx/vhost.conf Normal file
View File

@ -0,0 +1,52 @@
server
{
listen 80;
server_name _;
root /app/public;
index index.php index.html;
#必须放在解析PHP之前
#禁止目录执行php SATRT
location ~* ^/(h5|guoqi|static|upload)/.*\.(php|php5|php7|php8)$ {
default_type application/json;
return 200 '{"message":"You are definitely a particularly bad big fool."}';
}
#禁止目录执行php END
include /opt/docker/etc/nginx/enable-php.conf;
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}
location ~ ^/(\.user.ini|\.htaccess|\.git|\.env|\.svn|\.project|LICENSE|README.md)
{
return 404;
}
location ~ \.well-known{
allow all;
}
if ( $uri ~ "^/\.well-known/.*\.(php|jsp|py|js|css|lua|ts|go|zip|tar\.gz|rar|7z|sql|bak)$" ) {
return 403;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
error_log /dev/null;
access_log /dev/null;
}
location ~ .*\.(js|css)?$
{
expires 12h;
error_log /dev/null;
access_log /dev/null;
}
# 访问日志
access_log /docker.stdout;
error_log /docker.stderr;
}

55
index.html Executable file
View File

@ -0,0 +1,55 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Site is created successfully! </title>
<style>
.container {
width: 60%;
margin: 10% auto 0;
background-color: #f0f0f0;
padding: 2% 5%;
border-radius: 10px
}
ul {
padding-left: 20px;
}
ul li {
line-height: 2.3
}
a {
color: #20a53a
}
.footer {
/* position: absolute;
left: 0;
bottom: 32px;
width: 100%; */
margin-top: 24px;
text-align: center;
font-size: 12px;
}
.footer .btlink {
color: #20a53a;
text-decoration: none;
}
</style>
</head>
<body>
<div class="container">
<h1>Congratulations, the site is created successfully! </h1>
<h3>This is the default index.html, this page is automatically generated by the system</h3>
<ul>
<li>The index.html of this page is in the site root directory</li>
<li>You can modify, delete or overwrite this page</li>
</ul>
</div>
<!--<div class="footer">
Power by
<a class="btlink" href="https://www.aapanel.com/new/download.html?invite_code=aapanele" target="_blank">aaPanel (The Free, Efficient and secure hosting control panel)</a>
</div> -->
</body>
</html>

1
public/.dockerignore Normal file
View File

@ -0,0 +1 @@
.user.ini

123
public/chatlink.html Executable file
View File

@ -0,0 +1,123 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible " content="IE=edge" />
<meta name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>在线咨询</title>
<style>
html,
body {
width: 100%;
height: 100%;
margin: 0;
padding: 0
}
</style>
</head>
<body>
<script type="text/javascript">
function parse(query) {
var qs = {};
var i = query.indexOf('?');
if (i < 0 && query.indexOf('=') < 0) {
return qs;
} else if (i >= 0) {
query = query.substring(i + 1);
}
var parts = query.split('&');
for (var n = 0; n < parts.length; n++) {
var part = parts[n];
var key = part.split('=')[0];
var val = part.split('=')[1];
key = key.toLowerCase();
if (typeof qs[key] === 'undefined') {
qs[key] = decodeURIComponent(val);
} else if (typeof qs[key] === 'string') {
var arr = [qs[key], decodeURIComponent(val)];
qs[key] = arr;
} else {
qs[key].push(decodeURIComponent(val));
}
}
return qs;
}
function init() {
(function (m, ei, q, i, a, j, s) {
m[i] =
m[i] ||
function () {
(m[i].a = m[i].a || []).push(arguments);
};
(j = ei.createElement(q)), (s = ei.getElementsByTagName(q)[0]);
j.async = true;
j.charset = 'UTF-8';
j.src = 'https://static.meiqia.com/widget/loader.js';
s.parentNode.insertBefore(j, s);
})(window, document, 'script', '_MEIQIA');
var data = parse(window.location.search);
var entId = data.entid || data.eid;
if (Object.prototype.toString.call(entId) === '[object Array]') {
entId = +entId[0];
} else {
entId = +entId;
}
_MEIQIA('entId', 'a968261aa97f7f10847326aebecb08bf' || entId);
_MEIQIA('standalone', function (config) {
if (config.color) {
document.body.style['background-color'] = '#' + config.color;
}
if (config.url) {
document.body.style['background-image'] = 'url(' + config.url + ')';
document.body.style['background-repeat'] = 'no-repeat';
document.body.style['background-size'] = '100% 100%';
}
});
_MEIQIA('withoutBtn');
if (data.metadata) {
try {
var metadata = JSON.parse(data.metadata);
_MEIQIA('metadata', metadata);
} catch (e) { }
}
if (data.encryptedmetadata) {
_MEIQIA('encryptedmetadata', data.encryptedmetadata);
}
if (data.requestperms) {
localStorage.setItem('requestperms', data.requestperms);
}
if (data.language) {
if (data.languagelocal !== 'true') {
_MEIQIA('language', data.language);
}
}
if (data.languagelocal === 'true') {
_MEIQIA('languageLocal', true);
}
if (data.subsource) {
_MEIQIA('subSource', data.subsource);
}
if (data.fallback) {
_MEIQIA('fallback', +data.fallback);
}
if (data.socketprotocol) {
_MEIQIA('socketProtocol', data.socketprotocol);
}
_MEIQIA('handleParams', data);
if (data.clientid) {
_MEIQIA('clientId', data.clientid);
}
if (data.agentid || data.groupid) {
_MEIQIA('assign', { agentToken: data.agentid || null, groupToken: data.groupid || null });
}
_MEIQIA('showPanel', {
greeting: data.greeting || '',
agentToken: data.agentid || null,
groupToken: data.groupid || null
});
}
init();
</script>
</body >
</html >

BIN
public/guoqi/1.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

BIN
public/guoqi/10.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
public/guoqi/11.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
public/guoqi/12.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
public/guoqi/13.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
public/guoqi/14.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
public/guoqi/1bnb.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
public/guoqi/2.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
public/guoqi/2eth.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
public/guoqi/3.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
public/guoqi/4.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
public/guoqi/5.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

BIN
public/guoqi/6.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
public/guoqi/7.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
public/guoqi/8.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
public/guoqi/9.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
public/guoqi/BNB.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

BIN
public/guoqi/ERH.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

BIN
public/guoqi/Gold.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
public/guoqi/HBGTRX.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

BIN
public/guoqi/ada.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
public/guoqi/bch.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
public/guoqi/btc.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

BIN
public/guoqi/dash.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

BIN
public/guoqi/doge.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

BIN
public/guoqi/eos.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

BIN
public/guoqi/eth.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

BIN
public/guoqi/iota.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

BIN
public/guoqi/ltc.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
public/guoqi/usdt.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
public/guoqi/xrp.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

@ -1,6 +1,7 @@
#!/bin/sh
# 设置执行的持续时间60秒 = 1分钟
cd /www/wwwroot/weipan02_server/public
for i in {1..29}
cd /app/public
for i in $(seq 1 29)
do
php index.php /index/index/order
php index.php /index/index/product