48 lines
2.2 KiB
Markdown
48 lines
2.2 KiB
Markdown
Running and debugging with Docker or local Couchbase Lite storage
|
|
|
|
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).
|
|
|
|
Docker persistence:
|
|
|
|
- The app now uses an embedded Couchbase Lite database stored under `/data/couchbase` inside the container.
|
|
- The compose file mounts that path from `${WORKTRACKER_DATA_PATH:-./.docker-data/couchbase}` on the host.
|
|
- Set `WORKTRACKER_DATA_PATH` before `docker compose up` if you want to move the database elsewhere.
|
|
|
|
Development in VS Code without Docker:
|
|
|
|
- Use the `WorkTracker: Debug Local` launch configuration.
|
|
- VS Code builds the project, starts the app directly with `ASPNETCORE_ENVIRONMENT=Development`, and opens the local URL when the server is ready.
|
|
- Local development data is stored in `App_Data/couchbase-dev` by default.
|
|
|
|
Development in Docker:
|
|
|
|
- The override file keeps a containerized `dotnet watch` flow for cases where you still want Docker.
|
|
- The development container mounts the workspace into `/workspace` and stores its Couchbase Lite files under `./.docker-data/couchbase-dev` on the host.
|
|
|
|
Debugging in Docker from VS Code:
|
|
|
|
- Use the `WorkTracker: Debug in Docker` launch configuration.
|
|
- VS Code brings up the development container with `docker compose`, builds the app in `Debug`, and launches `WorkTracker.dll` under `vsdbg` inside the container.
|
|
- When the app reports that it is listening, VS Code automatically opens Microsoft Edge in browser debug mode against http://localhost:8002.
|
|
- The app remains available at http://localhost:8002 while the debugger is attached.
|
|
- Stopping the debug session runs `docker compose down` for the debug stack.
|
|
|
|
Manual development start:
|
|
|
|
- `docker compose up --build`
|
|
|
|
Manual shutdown:
|
|
|
|
- `docker compose down`
|
|
|
|
Notes:
|
|
|
|
- The base compose file remains production-oriented; the override file is the optional containerized development layer.
|
|
- The first container build takes longer because the dev image installs the .NET debugger.
|
|
- The Dockerfile uses the .NET 10 `*-noble` images so local builds and container builds stay aligned with the SDK available in VS Code.
|