chore: 增加 Docker 单容器部署

生产用 Dockerfile + compose 嵌入前端二进制,run.sh docker 一键构建启动。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Logan.LiandCursor committed 2026-08-12 12:02:29 +08:00
1 parent 95405de119
commit cb1a9be2c4
7 files changed
+224 -4

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
# opsx-licence Docker 部署(单容器:管理后台 + /api)
# 用法:
# cp .env.example .env # 填 JWT / Waffo
# docker compose up -d --build
# # 或旧版: docker-compose up -d --build
# 署名 Logan.Li
services:
opsx-licence:
image: opsx-licence:${VERSION:-latest}
build:
context: .
dockerfile: Dockerfile
container_name: opsx-licence
restart: unless-stopped
ports:
- "${HOST_PORT:-9001}:9001"
env_file:
- .env
environment:
TZ: Asia/Shanghai
PORT: "9001"
GIN_MODE: ${GIN_MODE:-release}
DB_DRIVER: sqlite
DB_NAME: /data/db.sqlite3
volumes:
- licence_data:/data
healthcheck:
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:9001/health"]
interval: 15s
timeout: 3s
retries: 5
start_period: 15s
volumes:
licence_data: