Skip to content

Commit

Permalink
fix: 🐛 安装状态保存不正确
Browse files Browse the repository at this point in the history
  • Loading branch information
monlor committed Jul 9, 2024
1 parent 8a8a7ad commit 7d5aca2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion 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 2.0.0
LABEL VERSION 2.0.1

ENV TZ Asia/Shanghai

Expand Down
2 changes: 1 addition & 1 deletion epay/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
image: monlor/epay
container_name: epay
volumes:
- epay:/var/www/html
- epay:/data
ports:
- "80:80"
depends_on:
Expand Down
24 changes: 20 additions & 4 deletions epay/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,27 @@

set -e

# 先更新安装文件
cp -rf /var/www/html/install/ /data/install/
if [ -n "${INSTALLED:-}" ]; then
echo "使用环境变量设置安装状态..."
if [ "${INSTALLED}" = "true" ]; then
echo "安装锁" > /var/www/html/install/install.lock
else
rm -rf /var/www/html/install/install.lock
fi
else
echo "使用挂载卷保存安装状态..."

# 软连接安装文件,保存install.lock
ln -sf /data/install /var/www/html/install
if [ ! -d /data/install ]; then
mkdir -p /data/install
fi

# 先更新安装文件
mv -f /var/www/html/install/* /data/install
rm -rf /var/www/html/install

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

cat > /var/www/html/config.php <<-EOF
<?php
Expand Down

0 comments on commit 7d5aca2

Please sign in to comment.