master
jinql 2025-09-04 23:13:16 +08:00
parent 0b1c3fddcd
commit 407c803550
2 changed files with 15 additions and 7 deletions

View File

@ -1,8 +1,16 @@
services: services:
web: favicon-api:
build: . image: favicon-api:latest
container_name: favicon-api
ports: ports:
- "8000:8000" - 8001:8000
environment:
TZ: Asia/Shanghai
volumes: volumes:
- .:/app - /usr/share/zoneinfo/Asia/Shanghai:/usr/share/zoneinfo/Asia/Shanghai:ro
command: uvicorn main:app --host 0.0.0.0 --port 8000 --reload - /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- ./data:/app/data:rw
- ./conf:/app/conf:rw
- ./logs:/app/logs:rw
restart: unless-stopped

View File

@ -13,7 +13,7 @@ if [ ! -f "$gunicorn_conf" ]; then
if [ -f "$default_conf_dir/gunicorn_conf_py" ]; then if [ -f "$default_conf_dir/gunicorn_conf_py" ]; then
cp "$default_conf_dir/gunicorn_conf_py" "$gunicorn_conf" cp "$default_conf_dir/gunicorn_conf_py" "$gunicorn_conf"
chmod 644 "$gunicorn_conf" chmod 644 "$gunicorn_conf"
echo "成功复制gunicorn.conf.py" echo "复制gunicorn.conf.py成功"
else else
echo "警告:默认配置文件 $default_conf_dir/gunicorn_conf_py 不存在,创建空文件" echo "警告:默认配置文件 $default_conf_dir/gunicorn_conf_py 不存在,创建空文件"
touch "$gunicorn_conf" touch "$gunicorn_conf"
@ -26,7 +26,7 @@ if [ ! -f "$logging_conf" ]; then
if [ -f "$default_conf_dir/logging.yaml" ]; then if [ -f "$default_conf_dir/logging.yaml" ]; then
cp "$default_conf_dir/logging.yaml" "$logging_conf" cp "$default_conf_dir/logging.yaml" "$logging_conf"
chmod 644 "$logging_conf" chmod 644 "$logging_conf"
echo "成功复制logging.yaml" echo "复制logging.yaml成功"
else else
echo "警告:默认配置文件 $default_conf_dir/logging.yaml 不存在,创建空文件" echo "警告:默认配置文件 $default_conf_dir/logging.yaml 不存在,创建空文件"
touch "$logging_conf" touch "$logging_conf"