This project was generated using Angular CLI v21.0.0 and includes Docker support for local development.
- Docker Desktop (Linux containers)
- Docker Compose (v2) included with Docker Desktop
- Node/npm only required on the host if you want to run locally without Docker
This repository includes a Dockerfile and docker-compose.yml to run the dev server in a container.
- Build and start (PowerShell):
# Rebuild image and start (foreground)
docker compose build --no-cache
docker compose up --build
# Or run detached
docker compose up --build -d-
Open the app in a browser: http://localhost:4200
-
Follow logs:
docker compose logs -f angular-app- Open a shell in the running container (for debugging):
docker compose run --service-ports --rm angular-app sh
# or if bash exists:
docker compose run --service-ports --rm angular-app bash- Builds an image from the provided Dockerfile.
- Exposes port 4200 on the host.
- Mounts the project directory into the container for live code updates.
- Uses a named Docker volume
node_modulesto preserve container-installed dependencies and avoid hiding them with a host mount. - Sets
CHOKIDAR_USEPOLLING=trueto improve file-watch reliability on Windows hosts.
- Rebuild image and recreate containers:
docker compose up --build -d- Show container logs:
docker compose logs -f- Stop and remove containers:
docker compose down- If you see errors like
sh: ng: not foundorspawn ng ENOENT, the container cannot findnode_modules/.bin/ng. Ensure the namednode_modulesvolume is used (see docker-compose.yml) and the image build completednpm install. - If file watching does not detect changes on Windows, ensure Docker Desktop is running Linux containers and
CHOKIDAR_USEPOLLING=trueis set in docker-compose.yml (already configured). - For reproducible installs in CI, consider adding a
package-lock.jsonand usingnpm ciin the Dockerfile. - To debug Node version mismatch, run
docker compose run --rm angular-app node --version.
Run these commands on a host with Node installed:
npm install
ng serve --host 0.0.0.0If you want, an entrypoint script can be added to run npm install automatically when the node_modules volume is empty — say if you prefer the container to self-bootstrap.