Auto-configure server on first Docker run

This commit is contained in:
Fimeg
2025-10-29 13:01:28 -04:00
parent 237e04531f
commit 1acddb58a5
2 changed files with 5 additions and 12 deletions

View File

@@ -87,19 +87,13 @@ cd RedFlag
# Build agent (one-time)
cd aggregator-agent && go mod tidy && go build -o redflag-agent cmd/agent/main.go && cd ..
# Start database and server
# Start database and server (auto-configures on first run)
docker-compose up -d
# Setup server (one-time)
docker-compose exec server ./redflag-server --setup
# Watch setup progress (optional)
docker-compose logs -f server
# Run database migrations
docker-compose exec server ./redflag-server --migrate
# Restart server with configuration
docker-compose restart server
# Access: http://localhost:8080
# When setup is complete, access: http://localhost:8080
# Admin: http://localhost:8080/admin
```

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
postgres:
image: postgres:16-alpine
@@ -41,6 +39,7 @@ services:
- REDFLAG_DB_PASSWORD=redflag
- REDFLAG_SERVER_HOST=0.0.0.0
- REDFLAG_SERVER_PORT=8080
command: ["sh", "-c", "if [ ! -f /app/.env ]; then ./redflag-server --setup; fi && ./redflag-server --migrate && ./redflag-server"]
restart: unless-stopped
volumes: