Local SQL Server via Docker
for WebhookFlow
Run a full SQL Server 2022 instance on your Windows machine using Docker — same engine as Azure SQL Database, works offline, one command to start and stop, data persists between restarts.
| Option | Internet needed | Speed | Reset | Use when |
|---|---|---|---|---|
| Azure SQL Database | Yes | Slight network latency | Drop + recreate DB in portal | Shared dev, staging, production |
| Local Docker SQL Server ✓ | No (after image pulled) | Fastest — localhost | docker rm then re-run |
Individual dev, offline, rapid iteration |
mcr.microsoft.com/mssql/server:2022-latest — the same SQL Server 2022 engine that powers Azure SQL Database. Your queries, stored procedures, and JDBC driver are 100% compatible. Switching between local and Azure is a one-line change in application.properties.
Docker Desktop running on Windows
Open Docker Desktop and confirm the whale icon in the taskbar shows Docker Desktop is running. If not set up yet, see the Docker Desktop Setup guide.
At least 2 GB RAM available
SQL Server requires a minimum of 2 GB RAM. In Docker Desktop → Settings → Resources, ensure at least 3 GB is allocated to Docker.
Port 1433 free
Check nothing else is using port 1433 (the default SQL Server port). In PowerShell: netstat -ano | findstr :1433. If it shows a process, stop it first.
| Flag | What it does |
|---|---|
| -e "ACCEPT_EULA=Y" | Accept the SQL Server licence agreement (required) |
| -e "SA_PASSWORD=..." | Set the sa (system administrator) password — must be 8+ chars, mixed case, number, symbol |
| -p 1433:1433 | Map container port 1433 to your Windows localhost:1433 |
| --name webhookflow-sql | Give the container a friendly name so you can start/stop by name |
| -v webhookflow-data:... | Named Docker volume — your data survives container restarts and recreates |
| -d | Run in background (detached) |
| mcr.microsoft.com/... | Official Microsoft SQL Server 2022 image from Microsoft Container Registry |
Confirm it started
You should see a row with webhookflow-sql and status Up. Wait ~10 seconds after starting before connecting — SQL Server takes a moment to initialise.
Open a shell inside the running container
Create the database, then exit
@Entity classes and runs CREATE TABLE for webhook_event, webhook_subscription, delivery_log, and event_source automatically.
Optional — connect with Azure Data Studio (GUI)
| Field | Value |
|---|---|
| Server | localhost,1433 |
| Authentication type | SQL Login |
| User name | sa |
| Password | Webhook@1234 |
| Database | webhookflow |
| Encrypt connection | Optional (or False) |
| Trust server certificate | Yes |
mssql-jdbc works for both local Docker SQL Server and Azure SQL Database — no dependency change needed.
.env file and reference it as ${SA_PASSWORD}, or add application.properties to .gitignore.
Start the app
Watch the log for table creation
Call the health endpoint
Expected: {"status":"UP","totalEvents":0}
Confirm tables via sqlcmd
Should list 4 tables: webhook_event, webhook_subscription, delivery_log, event_source.
Full reset — wipe all data and start clean
The only difference between local Docker SQL Server and Azure SQL Database is the connection URL in application.properties. Everything else — the JDBC driver, JPA config, entity classes — stays identical.
Local Docker SQL Server
Azure SQL Database
application-local.properties with the Docker URL and application-azure.properties with the Azure URL. Switch with -Dspring.profiles.active=local or =azure. This way the main application.properties stays clean with only shared config.
| Error | Cause | Fix |
|---|---|---|
Connection refused localhost:1433 |
Container not running or still starting | Run docker ps — if not running, docker start webhookflow-sql. Wait 10 sec after start. |
Login failed for user 'sa' |
Wrong password in properties | Password in application.properties must match SA_PASSWORD used in docker run |
Database 'webhookflow' not found |
Database not created inside container | Run the docker exec ... CREATE DATABASE webhookflow command from Step 2 |
| Docker Desktop not starting | WSL2 or virtualisation issue | See the Docker Desktop Setup guide for Windows troubleshooting |
Insufficient memory in Docker logs |
Docker has less than 2 GB RAM | Docker Desktop → Settings → Resources → increase Memory to 3 GB |
| Port 1433 already in use | Another SQL Server instance running on Windows | Stop the other instance, or map to a different port: change -p 1433:1433 to -p 1434:1433 and update the JDBC URL to localhost,1434 |
sqlcmd: command not found inside container |
Tools path changed in newer images | Try /opt/mssql-tools/bin/sqlcmd (without the 18) as the fallback path |