Compare commits

..

4 Commits

Author SHA1 Message Date
huangzhenpc
66d72c7b3b fix(deploy): add compose project name to avoid cross-project conflicts
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
Both projects use deploy/ directory, causing Docker Compose to share
the same project name "deploy" and volume namespace. Adding explicit
name: fireflyapi isolates volumes and containers completely.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 15:22:25 +08:00
huangzhenpc
90c36bb559 feat(deploy): use external build + image instead of compose build
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
Build image separately with: docker build -t fireflyapi:latest .
Consistent with StarfireAPI deployment pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 14:49:51 +08:00
huangzhenpc
8a22b95906 feat(deploy): change default port to 6680 for independent deployment
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
Avoid port conflict with StarfireAPI (6580) on the same server.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 14:47:49 +08:00
huangzhenpc
51d8badb05 feat(deploy): switch to local build and rebrand docker-compose
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
- Replace upstream image with local Dockerfile build
- Rename service/container names to fireflyapi
- Update default DB user/name to fireflyapi
- Update default admin email to fireflyapi.local
- Rename network to fireflyapi-network

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 14:21:05 +08:00

View File

@@ -1,30 +1,33 @@
# ============================================================================= # =============================================================================
# Sub2API Docker Compose Configuration # FireflyAPI Docker Compose Configuration
# ============================================================================= # =============================================================================
# Quick Start: # Quick Start:
# 1. Copy .env.example to .env and configure # 1. Build image: docker build -t fireflyapi:latest . (in project root)
# 2. docker-compose up -d # 2. Copy .env.example to .env and configure
# 3. Check logs: docker-compose logs -f sub2api # 3. docker-compose up -d
# 4. Check logs: docker-compose logs -f fireflyapi
# 4. Access: http://localhost:8080 # 4. Access: http://localhost:8080
# #
# All configuration is done via environment variables. # All configuration is done via environment variables.
# No Setup Wizard needed - the system auto-initializes on first run. # No Setup Wizard needed - the system auto-initializes on first run.
# ============================================================================= # =============================================================================
name: fireflyapi
services: services:
# =========================================================================== # ===========================================================================
# Sub2API Application # FireflyAPI Application
# =========================================================================== # ===========================================================================
sub2api: fireflyapi:
image: weishaw/sub2api:latest image: fireflyapi:latest
container_name: sub2api container_name: fireflyapi
restart: unless-stopped restart: unless-stopped
ulimits: ulimits:
nofile: nofile:
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:-6680}: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
@@ -50,9 +53,9 @@ services:
# ======================================================================= # =======================================================================
- DATABASE_HOST=postgres - DATABASE_HOST=postgres
- DATABASE_PORT=5432 - DATABASE_PORT=5432
- DATABASE_USER=${POSTGRES_USER:-sub2api} - DATABASE_USER=${POSTGRES_USER:-fireflyapi}
- DATABASE_PASSWORD=${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required} - DATABASE_PASSWORD=${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
- DATABASE_DBNAME=${POSTGRES_DB:-sub2api} - DATABASE_DBNAME=${POSTGRES_DB:-fireflyapi}
- DATABASE_SSLMODE=disable - DATABASE_SSLMODE=disable
# ======================================================================= # =======================================================================
@@ -67,7 +70,7 @@ services:
# ======================================================================= # =======================================================================
# Admin Account (auto-created on first run) # Admin Account (auto-created on first run)
# ======================================================================= # =======================================================================
- ADMIN_EMAIL=${ADMIN_EMAIL:-admin@sub2api.local} - ADMIN_EMAIL=${ADMIN_EMAIL:-admin@fireflyapi.local}
- ADMIN_PASSWORD=${ADMIN_PASSWORD:-} - ADMIN_PASSWORD=${ADMIN_PASSWORD:-}
# ======================================================================= # =======================================================================
@@ -133,7 +136,7 @@ services:
redis: redis:
condition: service_healthy condition: service_healthy
networks: networks:
- sub2api-network - fireflyapi-network
healthcheck: healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"] test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s interval: 30s
@@ -146,7 +149,7 @@ services:
# =========================================================================== # ===========================================================================
postgres: postgres:
image: postgres:18-alpine image: postgres:18-alpine
container_name: sub2api-postgres container_name: fireflyapi-postgres
restart: unless-stopped restart: unless-stopped
ulimits: ulimits:
nofile: nofile:
@@ -155,14 +158,14 @@ services:
volumes: volumes:
- postgres_data:/var/lib/postgresql/data - postgres_data:/var/lib/postgresql/data
environment: environment:
- POSTGRES_USER=${POSTGRES_USER:-sub2api} - POSTGRES_USER=${POSTGRES_USER:-fireflyapi}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
- POSTGRES_DB=${POSTGRES_DB:-sub2api} - POSTGRES_DB=${POSTGRES_DB:-fireflyapi}
- TZ=${TZ:-Asia/Shanghai} - TZ=${TZ:-Asia/Shanghai}
networks: networks:
- sub2api-network - fireflyapi-network
healthcheck: healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-sub2api} -d ${POSTGRES_DB:-sub2api}"] test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-fireflyapi} -d ${POSTGRES_DB:-fireflyapi}"]
interval: 10s interval: 10s
timeout: 5s timeout: 5s
retries: 5 retries: 5
@@ -175,7 +178,7 @@ services:
# =========================================================================== # ===========================================================================
redis: redis:
image: redis:8-alpine image: redis:8-alpine
container_name: sub2api-redis container_name: fireflyapi-redis
restart: unless-stopped restart: unless-stopped
ulimits: ulimits:
nofile: nofile:
@@ -195,7 +198,7 @@ services:
# REDISCLI_AUTH is used by redis-cli for authentication (safer than -a flag) # REDISCLI_AUTH is used by redis-cli for authentication (safer than -a flag)
- REDISCLI_AUTH=${REDIS_PASSWORD:-} - REDISCLI_AUTH=${REDIS_PASSWORD:-}
networks: networks:
- sub2api-network - fireflyapi-network
healthcheck: healthcheck:
test: ["CMD", "redis-cli", "ping"] test: ["CMD", "redis-cli", "ping"]
interval: 10s interval: 10s
@@ -218,5 +221,5 @@ volumes:
# Networks # Networks
# ============================================================================= # =============================================================================
networks: networks:
sub2api-network: fireflyapi-network:
driver: bridge driver: bridge