mirror of
https://github.com/alexhopeoconnor/dnsmasq-webui.git
synced 2026-10-03 22:12:00 +10:00
- Parsers: Superpower for all (Directive, FileLine, Include, DhcpHost, Leases, Hosts) - Shared ConfParserHelpers (Token, OptionalCommentPrefix) - DnsmasqConfOptionRegistry + DnsmasqOptionKind: typed options (ConfFile, ConfDir, Domain, DhcpRange, Server, Local, Address, DhcpOption, DhcpHost, Path, Flag, etc.) - EnsureManagedConfigHostedService: append conf-dir= to main config if missing, then create managed file; DnsmasqOptions + Dockerfile comments for permissions - Renames: ConfigLine->DnsmasqConfLine, ConfigSet->DnsmasqConfigSet, etc. - Test harness: entrypoint in scripts/, prepare-test-mount improvements - Status/Reload API and UI: stdout+stderr, exit code
33 lines
1.1 KiB
Docker
33 lines
1.1 KiB
Docker
# App + dnsmasq in one container (test harness). Both run as root; file permissions work
|
|
# because config dirs are in the container. For UI in container + dnsmasq on host, see
|
|
# DnsmasqOptions XML doc (permissions and ReloadCommand/StatusCommand scope).
|
|
# Stages mirror Dockerfile; final stage adds dnsmasq.
|
|
|
|
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 procps \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
COPY scripts/entrypoint.sh .
|
|
RUN chmod +x entrypoint.sh
|
|
ENTRYPOINT ["./entrypoint.sh"]
|