WorkTracker/README.Docker.md
MaddoScientisto 7029e374cc
Some checks failed
Publish Container / publish (push) Has been cancelled
Refactor authentication system to use MongoDB
- Removed Entity Framework Core identity schema and related migrations.
- Introduced MongoDB-based authentication service with user seeding functionality.
- Updated Program.cs to configure authentication and authorization using cookies.
- Created new Login.razor component for user login interface.
- Added RedirectToLogin component for handling unauthorized access.
- Updated Dockerfile and docker-compose files for development and production environments.
- Removed SQLite connection strings and related configurations.
- Added MongoDB connection settings in appsettings.json and Docker configurations.
- Implemented IMongoAuthService interface and MongoAuthService class for user management.
- Created MongoAuthUser model for MongoDB user representation.
2026-03-16 21:54:44 +01:00

1.4 KiB

Running and debugging with Docker (includes MongoDB)

Quick run (Docker Engine required):

  1. Build and start services:

    docker compose up --build

  2. App will be available on host port 8002 -> container 8080 (http://localhost:8002).

Development in VS Code (F5):

  • The repository uses docker-compose.yml plus docker-compose.override.yml as the single development stack.
  • The override file switches the app container to the SDK-based dev image, mounts the workspace into /workspace, installs vsdbg, and runs dotnet watch.
  • Press F5 in VS Code with the Docker: Attach .NET in Compose - F5 configuration selected.
  • VS Code starts Docker Compose, waits for http://localhost:8002, opens the browser, and attaches the debugger to the worktracker-dev container.

Manual development start:

  • docker compose up --build

Manual shutdown:

  • docker compose down

MongoDB:

  • The compose stack includes a mongo service and a named volume mongo_data for persistence.
  • The app uses MongoDb__ConnectionString: mongodb://mongo:27017 inside the compose network.

Notes:

  • The base compose file remains production-oriented; the override file is the development/debug layer that VS Code uses automatically.
  • The first container build takes longer because the dev image installs the .NET debugger.
  • The Dockerfile pins the .NET 10 images to the *-noble tags because the generic 10.0 SDK tag does not provide a usable SDK in this environment.