Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ cp UnsecuredAPIKeys.Bots.Verifier/appsettings.example.json UnsecuredAPIKeys.Bots
```

### 3. Start the Database

**Option A: Docker Compose (recommended for dev)**
```bash
docker compose up -d db
```

**Option B: One-off container**
```bash
docker run --name unsecured-api-keys-db \
-e POSTGRES_DB=UnsecuredAPIKeys \
Expand All @@ -88,6 +95,15 @@ docker run --name unsecured-api-keys-db \
-d postgres:15
```

### Stopping the database
```bash
docker compose down
```
To also remove the dev volume:
```bash
docker compose down -v
```

### 4. Run Database Migrations
```bash
cd UnsecuredAPIKeys.WebAPI
Expand Down Expand Up @@ -120,6 +136,7 @@ dotnet run
- **API**: http://localhost:7227
- **API Documentation**: http://localhost:7227/scalar/v1


## 📚 Documentation

- **[Deployment Guide](docs/DEPLOYMENT_GUIDE.md)** - Comprehensive deployment instructions
Expand Down
22 changes: 22 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: "3.9"

services:
db:
image: postgres:15
container_name: unsecuredapikeys-db
environment:
POSTGRES_DB: UnsecuredAPIKeys
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
volumes:
- dbdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d UnsecuredAPIKeys"]
interval: 5s
timeout: 3s
retries: 20

volumes:
dbdata: