mirror of
https://github.com/alexhopeoconnor/dnsmasq-webui.git
synced 2026-10-03 22:12:00 +10:00
- ASP.NET Core 9 Blazor Web App + Web API - Hosts file management (read/write, hosts(5) format) - DHCP static hosts (dhcp-host=, dnsmasq config) - DHCP leases (read-only, dnsmasq lease file format) - Reload and status commands (configurable) - Docker: standalone app image + Dockerfile.dnsmasq (app + dnsmasq) - docker-compose.test.yml: app + dhcp-client, testdata mount - Unit tests (Hosts, DhcpHost, Leases, DnsmasqConfig parsers) using testdata
31 lines
967 B
Docker
31 lines
967 B
Docker
# App + dnsmasq in one container (test harness). Stages mirror Dockerfile; final stage adds dnsmasq.
|
|
# One build: no need to build or tag the standalone app image first.
|
|
|
|
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
|
|
WORKDIR /app
|
|
EXPOSE 8080
|
|
EXPOSE 8081
|
|
|
|
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
|
WORKDIR /src
|
|
COPY ["src/DnsmasqWebUI/DnsmasqWebUI.csproj", "src/DnsmasqWebUI/"]
|
|
RUN dotnet restore "src/DnsmasqWebUI/DnsmasqWebUI.csproj"
|
|
COPY . .
|
|
WORKDIR "/src/src/DnsmasqWebUI"
|
|
RUN dotnet build "DnsmasqWebUI.csproj" -c Release -o /app/build
|
|
|
|
FROM build AS publish
|
|
RUN dotnet publish "DnsmasqWebUI.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
|
|
|
FROM base AS app
|
|
WORKDIR /app
|
|
ENV ASPNETCORE_URLS=http://+:8080
|
|
COPY --from=publish /app/publish .
|
|
|
|
FROM app AS final
|
|
RUN apt-get update && apt-get install -y --no-install-recommends dnsmasq \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
COPY entrypoint.sh .
|
|
RUN chmod +x entrypoint.sh
|
|
ENTRYPOINT ["./entrypoint.sh"]
|