The OSF angular project uses a docker image to simplify the developer process.
The container serves and rebuilds from mounted sources. The following host paths
are mounted into the container’s workdir (e.g., /app):
./public→/app/public./src→/app/src./angular.json→/app/angular.json./tsconfig.json→/app/tsconfig.json./tsconfig.app.json→/app/tsconfig.app.json
Notes:
node_modulesis installed inside the image during build; it is not mounted from the host.- The
start:dockercommand runs the Angular CLI build and development server inside the container.
It requires the project’s Angular configuration files (angular.json,tsconfig.json,tsconfig.app.json) to be present in the container’s/appdirectory.
If these are missing, the container will fail to build or serve the app.
The angular server is run from the docker image. localhost:4200 in any browser will display the site. Any changes to files in the /root/src directory will force the angular server to reload
The dev server binds to 0.0.0.0 inside the container so your host can reach it on http://localhost:4200.
If you don’t see the site, ensure the start script includes:
"start": "ng serve --host 0.0.0.0 --port 4200 --poll 2000"docker compose up -d --builddocker compose up -ddocker compose stopdocker compose down -vdocker compose psdocker compose logs -f web --tail=200(`--tail=200` shows the last 200 lines first, `-f` follows new output.)docker exec -it angular-dev shdocker imagesdocker rmi <IMAGE_ID>docker rmi <image_name>:<tag>docker rmi -f <IMAGE_ID>If the application does not open in your browser at http://localhost:4200, follow these steps in order:
-
Check if the container is running
docker compose ps
Look for the
webcontainer and verify its status isUp. -
Rebuild and recreate the container
If the container is not running, has exited, or the image is outdated:docker compose up --build -d
-
View container logs for errors
docker compose logs web
-
Test if the service responds locally
curl http://localhost:4200
You should see HTML output from the Angular app.
-
Verify that port 4200 is bound
docker compose port web 4200
This should return something like
0.0.0.0:4200or127.0.0.1:4200. -
Bypass browser caching issues
- Open the site in an incognito/private window.
- Or test with:
curl -I http://localhost:4200
-
Check network configuration
Ensure the web container is connected to the correct network:docker network ls docker network inspect <network_name>
-
Inspect live Angular CLI logs
If Angular is not serving content, run:docker compose exec web npm run start:docker -- --verbose -
If all else fails – reset and rebuild everything
docker compose down --volumes --remove-orphans docker compose up --build -d