Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects, and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Developer articles
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
webmonitor
WebMonitor
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
WebMonitor
/
compose.yaml
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
42 lines (37 loc) · 1.76 KB
main
Breadcrumbs
WebMonitor
/
compose.yaml
Copy path
Top
File metadata and controls
Code
Blame
42 lines (37 loc) · 1.76 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: webmonitor
services:
# 单体服务:FastAPI 同时提供 API 和前端静态页面,浏览器只访问一个 origin。
# 因此没有跨域:不再有 CORS 配置,也没有第二个前端容器。
webmonitor:
image: ${WEBMONITOR_IMAGE:-ghcr.io/webmonitor/webmonitor:latest}
pull_policy: always
container_name: webmonitor
restart: unless-stopped
environment:
# 数据库配置 - 使用SQLite
DATABASE_URL: sqlite:///./data/webmonitor.db
# JWT配置 - SECRET_KEY 必须显式提供(至少 32 字符),没有默认值
SECRET_KEY: ${SECRET_KEY:?请设置 SECRET_KEY(至少 32 个字符的随机串)}
ALGORITHM: HS256
ACCESS_TOKEN_EXPIRE_MINUTES: 30
TARGET_ALLOWED_ORIGINS: ${TARGET_ALLOWED_ORIGINS:-}
# 应用配置
DEBUG: ${DEBUG:-false}
LOG_LEVEL: ${LOG_LEVEL:-INFO}
# 首次启动引导管理员:库里已有管理员时这些值不会被使用。
# 没有管理员且 ADMIN_PASSWORD 为空时启动会失败,这是刻意的。
ADMIN_USERNAME: ${ADMIN_USERNAME:-admin}
ADMIN_EMAIL: ${ADMIN_EMAIL:-admin@example.com}
ADMIN_PASSWORD: ${ADMIN_PASSWORD:-}
# 没有部署级邮件配置:通知只会发到用户自己在应用里配置的 SMTP 地址。
# 任务可以不配邮件,那样只采集并记录日志。
ports:
# 页面与 API 共用这一个端口:http://localhost:8000/
- "8000:8000"
healthcheck:
# 镜像里不再安装 curl,探活用 Python 标准库
test: [ "CMD", "python", "-c", "import sys,urllib.request; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=5).status == 200 else 1)" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
You can’t perform that action at this time.