diff --git a/README.md b/README.md index 3e1e74e..7341399 100644 --- a/README.md +++ b/README.md @@ -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 \ @@ -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 @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..14c9e14 --- /dev/null +++ b/docker-compose.yml @@ -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: