配置StarFireAPI部署:端口6580,外部Redis(172.18.0.2:6379),前端显示StarFireAPI
Some checks failed
CI / test (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
Security Scan / backend-security (push) Has been cancelled
Security Scan / frontend-security (push) Has been cancelled

This commit is contained in:
huangzhenpc
2026-01-15 21:11:07 +08:00
parent f52498603c
commit 8d1e58cdac
2 changed files with 14 additions and 11 deletions

View File

@@ -15,7 +15,7 @@
BIND_HOST=0.0.0.0 BIND_HOST=0.0.0.0
# Server port (exposed on host) # Server port (exposed on host)
SERVER_PORT=8080 SERVER_PORT=6580
# Server mode: release or debug # Server mode: release or debug
SERVER_MODE=release SERVER_MODE=release
@@ -35,10 +35,12 @@ POSTGRES_PASSWORD=change_this_secure_password
POSTGRES_DB=sub2api POSTGRES_DB=sub2api
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Redis Configuration # Redis Configuration (External Redis)
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Leave empty for no password (default for local development) # Using external Redis server at 172.18.0.2:6379
REDIS_PASSWORD= REDIS_HOST=172.18.0.2
REDIS_PORT=6379
REDIS_PASSWORD=redis_JCHeKT
REDIS_DB=0 REDIS_DB=0
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------

View File

@@ -24,7 +24,7 @@ services:
soft: 100000 soft: 100000
hard: 100000 hard: 100000
ports: ports:
- "${BIND_HOST:-0.0.0.0}:${SERVER_PORT:-8080}:8080" - "${BIND_HOST:-0.0.0.0}:${SERVER_PORT:-6580}:8080"
volumes: volumes:
# Data persistence (config.yaml will be auto-generated here) # Data persistence (config.yaml will be auto-generated here)
- sub2api_data:/app/data - sub2api_data:/app/data
@@ -58,9 +58,9 @@ services:
# ======================================================================= # =======================================================================
# Redis Configuration # Redis Configuration
# ======================================================================= # =======================================================================
- REDIS_HOST=redis - REDIS_HOST=${REDIS_HOST:-172.18.0.2}
- REDIS_PORT=6379 - REDIS_PORT=${REDIS_PORT:-6379}
- REDIS_PASSWORD=${REDIS_PASSWORD:-} - REDIS_PASSWORD=${REDIS_PASSWORD:-redis_JCHeKT}
- REDIS_DB=${REDIS_DB:-0} - REDIS_DB=${REDIS_DB:-0}
# ======================================================================= # =======================================================================
@@ -119,8 +119,6 @@ services:
depends_on: depends_on:
postgres: postgres:
condition: service_healthy condition: service_healthy
redis:
condition: service_healthy
networks: networks:
- sub2api-network - sub2api-network
healthcheck: healthcheck:
@@ -160,9 +158,12 @@ services:
# 如需调试可临时添加ports: ["127.0.0.1:5433:5432"] # 如需调试可临时添加ports: ["127.0.0.1:5433:5432"]
# =========================================================================== # ===========================================================================
# Redis Cache # Redis Cache (DISABLED - Using external Redis at 172.18.0.2:6379)
# =========================================================================== # ===========================================================================
# Uncomment below if you want to use the built-in Redis instead of external
redis: redis:
profiles:
- disabled
image: redis:8-alpine image: redis:8-alpine
container_name: sub2api-redis container_name: sub2api-redis
restart: unless-stopped restart: unless-stopped