Compare commits

...

2 Commits

Author SHA1 Message Date
jeremygan2021
a1e8c042ca action
Some checks failed
Deploy to Server / deploy (push) Has been cancelled
2026-03-02 13:01:04 +08:00
jeremygan2021
0d140cd75c action 2026-03-02 12:59:46 +08:00
8 changed files with 55 additions and 9 deletions

2
.env
View File

@@ -1,7 +1,7 @@
# 环境变量配置文件
# 数据库配置
# DATABASE_URL=postgresql://luna:123luna@121.43.104.161:6432/luna
# DATABASE_URL=postgresql://luna:123luna@121.43.104.161:6433/luna
DATABASE_URL=postgresql://luna:123luna@6.6.6.66:5432/luna
DASHSCOPE_API_KEY=sk-a294f382488d46a1aa0d7cd8e750729b

View File

@@ -1,7 +1,7 @@
# 环境变量配置文件
# 数据库配置
# DATABASE_URL=postgresql://luna:123luna@121.43.104.161:6432/luna
# DATABASE_URL=postgresql://luna:123luna@121.43.104.161:6433/luna
DATABASE_URL=postgresql://luna:123luna@6.6.6.66:5432/luna
# MQTT配置
MQTT_BROKER_HOST=luna-mqtt

View File

@@ -1,7 +1,7 @@
# 环境变量配置文件
# 数据库配置
# DATABASE_URL=postgresql://luna:123luna@121.43.104.161:6432/luna
# DATABASE_URL=postgresql://luna:123luna@121.43.104.161:6433/luna
DATABASE_URL=postgresql://luna:123luna@6.6.6.66:5432/luna
# MQTT配置
MQTT_BROKER_HOST=luna-mqtt

View File

@@ -0,0 +1,45 @@
name: Deploy to Server
on:
push:
branches:
- main
- master
jobs:
deploy:
runs-on: ubuntu
steps:
- name: Checkout
uses: actions/checkout@v3
# 建议在 Gitea 仓库设置中配置 Secrets而不是直接写在文件中
# SERVER_HOST, SERVER_USER, SERVER_PASSWORD
- name: Copy files to server
uses: appleboy/scp-action@v0.1.7
with:
host: "6.6.6.66"
username: "quant-speed"
password: "123quant-speed"
source: "."
target: "/home/quant-speed/luna2025"
# 排除不需要上传的文件
exclude: ".git,.github,.gitea,.trae,__pycache__,*.pyc,*.pyo,*.pyd,.DS_Store"
- name: Deploy on server
uses: appleboy/ssh-action@v1.0.3
with:
host: "6.6.6.66"
username: "quant-speed"
password: "123quant-speed"
script: |
# 进入项目目录
cd /home/quant-speed/luna2025
# 停止容器并删除同名镜像
# --rmi local: 删除服务构建的镜像
echo "123quant-speed" | sudo -S docker compose down --rmi local
echo "123quant-speed" | sudo -S docker rmi epaper_server:latest || true
# 启动服务
echo "123quant-speed" | sudo -S docker compose up -d --build

View File

@@ -1,7 +1,7 @@
使用fastAPI框架
python 3.12
- 使用pg数据库 url http://121.43.104.161:6432
- 使用pg数据库 url http://121.43.104.161:6433
- 用户名luna
- 密码123luna

View File

@@ -3,7 +3,7 @@ from typing import Optional
class Settings(BaseSettings):
# 数据库配置1
#database_url: str = "postgresql://luna:123luna@121.43.104.161:6432/luna"
#database_url: str = "postgresql://luna:123luna@121.43.104.161:6433/luna"
database_url: str = "postgresql://luna:123luna@6.6.6.66:5432/luna"

View File

@@ -1,10 +1,11 @@
services:
# 主应用服务
luna-app:
epaper_server:
image: epaper_server:latest
build:
context: .
dockerfile: Dockerfile
container_name: luna-app
container_name: epaper_server
ports:
- "8199:8199"
volumes:

View File

@@ -17,9 +17,9 @@ SERVER_HOST="6.6.6.66" # 服务器IP地址
SERVER_USER="ubuntu" # 服务器用户名
SERVER_PASSWORD="qweasdzxc1" # 服务器密码
SERVER_PORT="22" # SSH端口默认22
IMAGE_NAME="epage_server" # Docker镜像名称
IMAGE_NAME="epaper_server" # Docker镜像名称
IMAGE_TAG="latest" # Docker镜像标签
CONTAINER_NAME="epage_server-container" # 容器名称
CONTAINER_NAME="epaper_server-container" # 容器名称
LOCAL_PORT="8199" # 本地端口
CONTAINER_PORT="8199" # 容器端口
TAR_FILE="${IMAGE_NAME}-${IMAGE_TAG}.tar" # 压缩包文件名