Reescrita dos geradores: biblioteca IGenerator, minimal API e novo frontend
- GeradoresService: cada tipo passa a ser um IGenerator (NIF, NIPC, NISS, CC, passaporte, IBAN, NIB, cartões, referência MB, pessoa, telefone, código postal, email, matrícula, EAN, UUID) registado em GeneratorRegistry; remove DAL/EF - GeradoresWS: minimal APIs em /api/v1 com OpenAPI + Scalar e health check - UnitTest: testes de ida e volta, valores conhecidos, detecção e API - geradoresfe: UI construída a partir dos metadados da API, validador livre, exportação CSV/JSON/TXT, nginx com API_UPSTREAM configurável - Docker, docker-compose e Jenkinsfile actualizados Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
33
Dockerfile
33
Dockerfile
@@ -1,31 +1,22 @@
|
||||
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 8080
|
||||
EXPOSE 443
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
# API (GeradoresWS). Contexto de build: raiz do repositório.
|
||||
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
COPY ["GeradoresWS/GeradoresWS.csproj", "GeradoresWS/"]
|
||||
COPY ["GeradoresService/GeradoresService.csproj", "GeradoresService/"]
|
||||
|
||||
RUN dotnet restore "GeradoresWS/GeradoresWS.csproj"
|
||||
COPY . .
|
||||
|
||||
WORKDIR "/src/GeradoresWS"
|
||||
RUN dotnet build "GeradoresWS.csproj" -c Release -o /app/build
|
||||
COPY GeradoresService/ GeradoresService/
|
||||
COPY GeradoresWS/ GeradoresWS/
|
||||
RUN dotnet publish "GeradoresWS/GeradoresWS.csproj" -c Release -o /app/publish --no-restore /p:UseAppHost=false
|
||||
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "GeradoresWS.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM base AS final
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
COPY --from=build /app/publish .
|
||||
|
||||
# Set environment variables
|
||||
ENV ASPNETCORE_URLS=http://+:8080
|
||||
ENV ASPNETCORE_ENVIRONMENT=Production
|
||||
ENV ASPNETCORE_HTTP_PORTS=8080 \
|
||||
ASPNETCORE_ENVIRONMENT=Production
|
||||
EXPOSE 8080
|
||||
USER $APP_UID
|
||||
|
||||
ENTRYPOINT ["dotnet", "GeradoresWS.dll"]
|
||||
ENTRYPOINT ["dotnet", "GeradoresWS.dll"]
|
||||
|
||||
Reference in New Issue
Block a user