mirror of
https://github.com/yyhuni/xingrin.git
synced 2026-02-08 07:33:12 +08:00
- Added a new test workflow to run comprehensive tests for the worker, server, and agent components. - Updated the main CI configuration to include the new test workflow. - Added a new Makefile for the agent to manage build, run, test, and lint tasks. - Updated .gitignore to exclude additional IDE files. - Removed redundant test steps from the CI configuration for cleaner execution.
88 lines
2.2 KiB
YAML
88 lines
2.2 KiB
YAML
# ============================================
|
||
# 生产环境配置 - 使用 Docker Hub 预构建镜像
|
||
# ============================================
|
||
name: lunafox
|
||
|
||
services:
|
||
# PostgreSQL(可选,使用远程数据库时不启动)
|
||
postgres:
|
||
profiles: ["local-db"]
|
||
image: postgres:16.3-alpine
|
||
restart: always
|
||
environment:
|
||
POSTGRES_DB: ${DB_NAME}
|
||
POSTGRES_USER: ${DB_USER}
|
||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||
volumes:
|
||
- postgres_data:/var/lib/postgresql/data
|
||
ports:
|
||
- "${DB_PORT}:5432"
|
||
healthcheck:
|
||
test: ["CMD-SHELL", "pg_isready -U ${DB_USER}"]
|
||
interval: 5s
|
||
timeout: 5s
|
||
retries: 5
|
||
|
||
redis:
|
||
image: redis:7.4.7-alpine
|
||
restart: always
|
||
healthcheck:
|
||
test: ["CMD", "redis-cli", "ping"]
|
||
interval: 5s
|
||
timeout: 5s
|
||
retries: 5
|
||
|
||
server:
|
||
image: yyhuni/lunafox-server:${IMAGE_TAG:?IMAGE_TAG is required}
|
||
restart: always
|
||
env_file:
|
||
- .env
|
||
environment:
|
||
- IMAGE_TAG=${IMAGE_TAG}
|
||
- PUBLIC_URL=${PUBLIC_URL:-}
|
||
depends_on:
|
||
redis:
|
||
condition: service_healthy
|
||
volumes:
|
||
- /opt/lunafox:/opt/lunafox
|
||
- /var/run/docker.sock:/var/run/docker.sock
|
||
healthcheck:
|
||
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
|
||
interval: 30s
|
||
timeout: 10s
|
||
retries: 3
|
||
start_period: 60s
|
||
|
||
frontend:
|
||
image: yyhuni/lunafox-frontend:${IMAGE_TAG:?IMAGE_TAG is required}
|
||
restart: always
|
||
depends_on:
|
||
server:
|
||
condition: service_healthy
|
||
healthcheck:
|
||
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000',res=>process.exit(res.statusCode<500?0:1)).on('error',()=>process.exit(1))"]
|
||
interval: 5s
|
||
timeout: 5s
|
||
retries: 20
|
||
start_period: 20s
|
||
|
||
nginx:
|
||
image: yyhuni/lunafox-nginx:${IMAGE_TAG:?IMAGE_TAG is required}
|
||
restart: always
|
||
depends_on:
|
||
server:
|
||
condition: service_healthy
|
||
frontend:
|
||
condition: service_healthy
|
||
ports:
|
||
- "8083:8083"
|
||
volumes:
|
||
- ./nginx/ssl:/etc/nginx/ssl:ro
|
||
|
||
volumes:
|
||
postgres_data:
|
||
|
||
networks:
|
||
default:
|
||
name: lunafox_network # 固定网络名,不随目录名变化
|