- 搭建 FastAPI、Redis、PostgreSQL、Nginx 与 Docker Compose 基础结构 - 实现反向代理、首用绑定、拦截告警、归档任务和管理接口 - 提供 Vue3 管理后台初版,以及 uv/requirements 双依赖配置
74 lines
1.5 KiB
YAML
74 lines
1.5 KiB
YAML
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
|