Auto-configure server on first Docker run
This commit is contained in:
parent
5effdf5ba9
commit
4732fcff43
2 changed files with 5 additions and 12 deletions
14
README.md
14
README.md
|
|
@ -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
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue