diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..4d72b4f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,30 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md +!**/.gitignore +!.git/HEAD +!.git/config +!.git/packed-refs +!.git/refs/heads/** \ No newline at end of file diff --git a/Directory.Packages.props b/Directory.Packages.props index 4e1a538..4b98617 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -27,6 +27,7 @@ + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0d0c946 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +#Runtime +FROM maurobernal/net8-base as base +USER root +WORKDIR /app +EXPOSE 80 +EXPOSE 443 +ENV ASPNETCORE_HTTP_PORTS=80; +ENV ASPNETCORE_HTTPS_PORTS=443; +ENV ASPNETCORE_URLS=http://*:80/;https://*:443/; +ENV ASPNETCORE_Kestrel__Certificates__Default__Path=/root/.aspnet/https/CertificadoCA.pfx +ENV ASPNETCORE_Kestrel__Certificates__Default__Password=Pass2024! +WORKDIR /root/ +COPY https .aspnet/https/ + +#Build +FROM maurobernal/net8-build AS build + +##Pass Solution +WORKDIR / +COPY . . + +WORKDIR /src/ +RUN dotnet build Web/Web.csproj -c Release -o /app/build + + +########################################## +FROM build as publish +USER root +RUN dotnet publish Web/Web.csproj -c Release -o /app/publish +FROM base as final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT [ "dotnet" , "ca.Web.dll"] \ No newline at end of file diff --git a/https/CertificadoCA.cer b/https/CertificadoCA.cer new file mode 100644 index 0000000..ad0e954 --- /dev/null +++ b/https/CertificadoCA.cer @@ -0,0 +1,31 @@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DTj1QdWJsaWMlMjBLZXklMjBTZXJ2aWNlcyxDTj1TZXJ2aWNlcyxDTj1D +b25maWd1cmF0aW9uLERDPUdBRyxEQz1MT0NBTD9jZXJ0aWZpY2F0ZVJldm9jYXRp +b25MaXN0P2Jhc2U/b2JqZWN0Q2xhc3M9Y1JMRGlzdHJpYnV0aW9uUG9pbnQwgbsG +CCsGAQUFBwEBBIGuMIGrMIGoBggrBgEFBQcwAoaBm2xkYXA6Ly8vQ049R0FHLUFD +MDItQ0EsQ049QUlBLENOPVB1YmxpYyUyMEtleSUyMFNlcnZpY2VzLENOPVNlcnZp +Y2VzLENOPUNvbmZpZ3VyYXRpb24sREM9R0FHLERDPUxPQ0FMP2NBQ2VydGlmaWNh +dGU/YmFzZT9vYmplY3RDbGFzcz1jZXJ0aWZpY2F0aW9uQXV0aG9yaXR5MA0GCSqG +SIb3DQEBCwUAA4IBAQAb1RRQQjZ/h7rvwAaJGTlYjohWFmqD8vgm9rWItyboGGjh +2Q0HsjqDAoaTG0xYwnxm71trWloaCjDYmDyTjmF39v9lYwXjn2snR0KIguIWuix5 +KboreTo7S4XqLAZPQbSHDolsioP14BleITuJpePYWb+WjGUSOXW0g8/lG5GjIP5Y +YxE0tie1vA+a0JqJIz5qpAH5amsqAyxEr/nuK4+17aqN/82XsZ8JMhchGBfyNtjs +BDbnx2LwFVcTlBggt1vbCaI2JG1mgpxyuxGYiSjwYNLz4QKRnyapXXUnhdbjPZjx +bkf4fn7BZHFtweuyWjTKdRjIz5F9QwNV0GHL3Xoh +-----END CERTIFICATE----- diff --git a/https/pedidoCAweb.req b/https/pedidoCAweb.req new file mode 100644 index 0000000..e439b18 --- /dev/null +++ b/https/pedidoCAweb.req @@ -0,0 +1,24 @@ +-----BEGIN NEW CERTIFICATE REQUEST----- +MIIEEjCCAvoCAQAwbTEQMA4GA1UECAwHTWVuZG96YTELMAkGA1UECwwCSVQxCzAJ +BgNVBAoMAk1CMRAwDgYDVQQHDAdNZW5kb3phMQ8wDQ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GPMbrpD4olAgNgufZaS/C9PNGqiOw/RtDlyF9J7z51TlvXpIINCIjQ3mBnf0 +b1u2vqN3yqIqfBkizJmrkB722d5YRRkcJYW3U1uyyav7mL0zSzvngs4jzqL6ilEp +xZUpDFr+DB64TgqD5xmMFmf8d7iRqB50NjwVX3pwI2dQ9vsLjyCpNo7AuRWaNh3j +pMb99O9iqeuenphaX15eG2HwUfVr+WncBW8/5uqQt6yFlR4ZjHA= +-----END NEW CERTIFICATE REQUEST----- diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..6daf194 --- /dev/null +++ b/install.sh @@ -0,0 +1,13 @@ +#!/bin/bash +image="maurobernal/ca" +id=$(date +'%Y%m%d%H%M') +imagename=$image:$id +echo "========== Build image:$imagename==========" +docker.exe build -t $imagename . +echo "========== Creating container image:$imagename==========" +docker.exe run -p8443:443 -p8080:80 -d $imagename + + +#docker.exe push $imagename +#echo "========== Deploy image:$imagename==========" + diff --git a/src/Web/Properties/launchSettings.json b/src/Web/Properties/launchSettings.json index dfa2a8b..6ffb261 100644 --- a/src/Web/Properties/launchSettings.json +++ b/src/Web/Properties/launchSettings.json @@ -1,35 +1,35 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:61846", - "sslPort": 44312 - } - }, - "profiles": { - "Web.Devel": { - "commandName": "Project", - "launchBrowser": true, - "applicationUrl": "https://localhost:5001;http://localhost:5000", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Web.Produ": { - "commandName": "Project", - "launchBrowser": true, - "applicationUrl": "https://localhost:5001;http://localhost:5000", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Production" - } - }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} +{ + "profiles": { + "Web.Devel": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:5001;http://localhost:5000" + }, + "Web.Produ": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Production" + }, + "applicationUrl": "https://localhost:5001;http://localhost:5000" + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + }, + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:61846", + "sslPort": 44312 + } + } +} diff --git a/src/Web/Web.csproj b/src/Web/Web.csproj index bbf16d5..516c508 100644 --- a/src/Web/Web.csproj +++ b/src/Web/Web.csproj @@ -17,6 +17,7 @@ + all @@ -34,6 +35,9 @@ OnBuildSuccess + 9bc47cec-3610-406c-9bbe-1a81008c1f7a + Linux + ..\..