Skip to content

Commit

Permalink
feat: 🎸 重构epay的部署方式
Browse files Browse the repository at this point in the history
  • Loading branch information
monlor committed Jul 9, 2024
1 parent b11939d commit 8a8a7ad
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-image-manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ on:
- media-unlock
- sniproxy
- xboard
- ws-scrapy
- ws-scrcpy
tag:
description: 'Image tag'

Expand Down
16 changes: 9 additions & 7 deletions epay/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM php:7.3-apache

LABEL MAINTAINER [email protected]
LABEL VERSION 1.0.1
LABEL VERSION 2.0.0

ENV TZ Asia/Shanghai

Expand All @@ -28,24 +28,26 @@ RUN apt-get update && apt-get install -y \
WORKDIR /var/www/html

# 下载v免签服务源代码并解压到镜像中
RUN git clone https://github.com/monlor/Epay-master /tmp/epay && \
chmod -R 777 /tmp/epay && \
rm -rf /tmp/epay/.git
RUN git clone https://github.com/monlor/Epay-master /var/www/html && \
chmod -R 777 /var/www/html && \
rm -rf /var/www/html/.git

# 开启伪静态支持
RUN a2enmod rewrite

# 添加 tokenpay 插件
RUN git clone https://github.com/LightCountry/TokenPay && \
cat TokenPay/Plugs/epay/*.sql > /tmp/epay/epay.sql && \
cat TokenPay/Plugs/epay/*.sql > /var/www/html/epay.sql && \
rm -rf TokenPay/Plugs/epay/*.sql TokenPay/Plugs/epay/{.git,README.md} && \
cp -a TokenPay/Plugs/epay/* /tmp/epay && \
cp -a TokenPay/Plugs/epay/* /var/www/html && \
rm -rf TokenPay

# Expose端口
EXPOSE 80

ADD plugins /tmp/epay/plugins
ADD plugins /var/www/html/plugins

ADD assets /var/www/html/assets

COPY start.sh /opt/start.sh

Expand Down
Binary file added epay/assets/icon/alipay.ico
Binary file not shown.
Binary file added epay/assets/icon/usdt.ico
Binary file not shown.
Binary file added epay/assets/icon/wxpay.ico
Binary file not shown.
28 changes: 18 additions & 10 deletions epay/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@

set -e

if [ -d /tmp/epay ]; then
echo "更新epay文件..."
if [ -f /var/www/html/install/install.lock ]; then
echo "检测到历史文件,恢复中..."
cp -rf /var/www/html/install/install.lock /tmp/epay/install
cp -rf /var/www/html/config.php /tmp/epay/config.php
fi
rsync -av --delete /tmp/epay/ /var/www/html/ &> /dev/null
rm -rf /tmp/epay
fi
# 先更新安装文件
cp -rf /var/www/html/install/ /data/install/

# 软连接安装文件,保存install.lock
ln -sf /data/install /var/www/html/install

cat > /var/www/html/config.php <<-EOF
<?php
/*数据库配置*/
\$dbconfig=array(
'host' => '${DB_HOST}', //数据库服务器
'port' => ${DB_PORT}, //数据库端口
'user' => '${DB_USERNAME}', //数据库用户名
'pwd' => '${DB_PASSWORD}', //数据库密码
'dbname' => '${DB_DATABASE}', //数据库名
'dbqz' => 'pay' //数据表前缀
);
EOF

apache2-foreground
File renamed without changes.
File renamed without changes.

0 comments on commit 8a8a7ad

Please sign in to comment.