This project uses a .env file for Docker Compose (to set the SQL Server password and database name) and the .NET app automatically loads the same variables at startup.
Before running the app:
-
Make sure you have Docker running.
-
Copy
.env_templateto.envand set your desired password:cp .env_template .env # Edit .env and set your password and database name if needed -
Start SQL Server with:
docker compose up -d
- The database specified in
DB_NAME(default:HRMSystemDb) will be created automatically at container startup using the script inmssql-init/init-db.sql.
- The database specified in
-
Run the API:
dotnet run --project HRMSystem.API
-
Access the API:
After starting the API, check your terminal output for the exact URL and port where the app is running.
The Swagger UI is typically available at a URL like:http://localhost:5084/swagger/index.html