Setup
dotnet new angular -n <project-name> --no-https --ProxyPort 4000
Dockerfile
FROM mcr.microsoft.com/dotnet/sdk:7.0-bookworm-slim
ENV NODE_MAJOR 20
RUN apt-get update \
&& apt-get install -y gnupg \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
| gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" \
| tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update \
&& apt-get install -y nodejs \
&& npm install -g npm
WORKDIR /app
# npm install -g @angular/cli
# ng new client --routing --skip-tests --skip-git --style CSS
# dotnet watch run --urls http://0.0.0.0:5000
COPY . /app
compose.yml
version: '3'
services:
app:
build: .
tty: true
ports:
- 5000:5000
- 4000:4000
volumes:
- ./src:/app
Makefile
.PHONY: up down shell
down:
docker compose down --rmi local --volumes --remove-orphans
up:
docker compose up $(filter-out $@,$(MAKECMDGOALS))
shell:
docker compose exec app bash
%:
@:
ClientApp/package.json
"start": "ng serve --host 0.0.0.0 --port 4000",
.csproj
<SpaProxyServerUrl>http://0.0.0.0:4000</SpaProxyServerUrl>
Properties/launchSettings.json
"applicationUrl": "http://localhost:5000",
Top comments (0)