mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-11 23:07:01 +08:00
Revert "Beta feat: migrate from SQLite to PostgreSQL + Redis architecture"
This commit is contained in:
@@ -1,44 +1,4 @@
|
||||
services:
|
||||
# PostgreSQL Database
|
||||
postgres:
|
||||
image: postgres:15-alpine
|
||||
container_name: nofx-postgres
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB:-nofx}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-nofx}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-nofx123456}
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- ./db/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
|
||||
ports:
|
||||
- "${POSTGRES_PORT:-5433}:5432"
|
||||
networks:
|
||||
- nofx-network
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-nofx}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
# Redis Cache
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: nofx-redis
|
||||
restart: unless-stopped
|
||||
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD:-redis123456}
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
ports:
|
||||
- "${REDIS_PORT:-6380}:6379"
|
||||
networks:
|
||||
- nofx-network
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
retries: 5
|
||||
|
||||
# Backend service (API and core logic)
|
||||
nofx:
|
||||
build:
|
||||
@@ -50,25 +10,13 @@ services:
|
||||
- "${NOFX_BACKEND_PORT:-8080}:8080"
|
||||
volumes:
|
||||
- ./config.json:/app/config.json:ro
|
||||
- ./config.db:/app/config.db
|
||||
- ./beta_codes.txt:/app/beta_codes.txt:ro
|
||||
- ./decision_logs:/app/decision_logs
|
||||
- ./prompts:/app/prompts
|
||||
- /etc/localtime:/etc/localtime:ro # Sync host time
|
||||
environment:
|
||||
- TZ=${NOFX_TIMEZONE:-Asia/Shanghai} # Set timezone
|
||||
- POSTGRES_HOST=postgres
|
||||
- POSTGRES_PORT=5432
|
||||
- POSTGRES_DB=${POSTGRES_DB:-nofx}
|
||||
- POSTGRES_USER=${POSTGRES_USER:-nofx}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-nofx123456}
|
||||
- REDIS_HOST=redis
|
||||
- REDIS_PORT=6379
|
||||
- REDIS_PASSWORD=${REDIS_PASSWORD:-redis123456}
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- nofx-network
|
||||
healthcheck:
|
||||
@@ -100,8 +48,4 @@ services:
|
||||
|
||||
networks:
|
||||
nofx-network:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
redis_data:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user