WorkTracker/README.Docker.md

35 lines
1.4 KiB
Markdown
Raw Normal View History

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.