feat(core): 初始化 Key-IP Sentinel 服务与部署骨架
- 搭建 FastAPI、Redis、PostgreSQL、Nginx 与 Docker Compose 基础结构 - 实现反向代理、首用绑定、拦截告警、归档任务和管理接口 - 提供 Vue3 管理后台初版,以及 uv/requirements 双依赖配置
This commit is contained in:
73
docker-compose.yml
Normal file
73
docker-compose.yml
Normal file
@@ -0,0 +1,73 @@
|
||||
services:
|
||||
nginx:
|
||||
image: nginx:alpine
|
||||
container_name: sentinel-nginx
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
depends_on:
|
||||
- sentinel-app
|
||||
volumes:
|
||||
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
- ./nginx/ssl:/etc/nginx/ssl:ro
|
||||
- ./frontend/dist:/etc/nginx/html/admin/ui:ro
|
||||
networks:
|
||||
- sentinel-net
|
||||
|
||||
sentinel-app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: key-ip-sentinel:latest
|
||||
container_name: sentinel-app
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
depends_on:
|
||||
- redis
|
||||
- postgres
|
||||
networks:
|
||||
- sentinel-net
|
||||
- llm-shared-net
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: sentinel-redis
|
||||
restart: unless-stopped
|
||||
command:
|
||||
[
|
||||
"sh",
|
||||
"-c",
|
||||
"if [ -n \"$REDIS_PASSWORD\" ]; then exec redis-server --requirepass \"$REDIS_PASSWORD\"; else exec redis-server; fi"
|
||||
]
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
networks:
|
||||
- sentinel-net
|
||||
|
||||
postgres:
|
||||
image: postgres:15
|
||||
container_name: sentinel-postgres
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: sentinel
|
||||
POSTGRES_PASSWORD: password
|
||||
POSTGRES_DB: sentinel
|
||||
volumes:
|
||||
- pg_data:/var/lib/postgresql/data
|
||||
- ./db/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
|
||||
networks:
|
||||
- sentinel-net
|
||||
|
||||
volumes:
|
||||
redis_data:
|
||||
pg_data:
|
||||
|
||||
networks:
|
||||
sentinel-net:
|
||||
driver: bridge
|
||||
llm-shared-net:
|
||||
external: true
|
||||
Reference in New Issue
Block a user