add global Dockerfile for heroku
This commit is contained in:
parent
211d3fdc03
commit
c7984f6fef
23
Apps/Api/Dockerfile
Normal file
23
Apps/Api/Dockerfile
Normal file
@ -0,0 +1,23 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
COPY *.sln .
|
||||
COPY Application/*.csproj ./Application/
|
||||
COPY Domain/*.csproj ./Domain/
|
||||
COPY Infrastructure/*.csproj ./Infrastructure/
|
||||
COPY Apps/Api/*.csproj ./Apps/Api/
|
||||
RUN dotnet restore
|
||||
|
||||
COPY Application/. ./Application/
|
||||
COPY Domain/. ./Domain/
|
||||
COPY Infrastructure/. ./Infrastructure/
|
||||
COPY Apps/Api/. ./Apps/Api/
|
||||
|
||||
WORKDIR /source/Apps/Api
|
||||
RUN dotnet publish -c release -o /app --no-restore
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:5.0
|
||||
WORKDIR /app
|
||||
COPY --from=build /app ./
|
||||
EXPOSE 80
|
||||
ENTRYPOINT ["dotnet", "Api.dll"]
|
||||
@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
@ -14,6 +15,7 @@ namespace Api
|
||||
Host.CreateDefaultBuilder(args)
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
{
|
||||
webBuilder.UseUrls($"http://0.0.0.0:{Environment.GetEnvironmentVariable("PORT") ?? "8888"}");
|
||||
webBuilder.UseStartup<Startup>();
|
||||
});
|
||||
}
|
||||
|
||||
@ -6,9 +6,13 @@
|
||||
|
||||
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
|
||||
|
||||
<MyField @bind-Name="_name" />
|
||||
|
||||
@code {
|
||||
private int currentCount = 0;
|
||||
|
||||
private string _name = "Julien";
|
||||
|
||||
private void IncrementCount()
|
||||
{
|
||||
currentCount++;
|
||||
|
||||
16
Apps/Client/Shared/MyField.razor
Normal file
16
Apps/Client/Shared/MyField.razor
Normal file
@ -0,0 +1,16 @@
|
||||
<p>Current name is @Name</p>
|
||||
<button @onclick="ChangeName">Change name to "John"</button>
|
||||
|
||||
@code
|
||||
{
|
||||
[Parameter]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<string> NameChanged { get; set ; }
|
||||
|
||||
private void ChangeName()
|
||||
{
|
||||
NameChanged.InvokeAsync("John");
|
||||
}
|
||||
}
|
||||
23
Dockerfile
Normal file
23
Dockerfile
Normal file
@ -0,0 +1,23 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /source
|
||||
|
||||
COPY *.sln .
|
||||
COPY Application/*.csproj ./Application/
|
||||
COPY Domain/*.csproj ./Domain/
|
||||
COPY Infrastructure/*.csproj ./Infrastructure/
|
||||
COPY Apps/Api/*.csproj ./Apps/Api/
|
||||
RUN dotnet restore
|
||||
|
||||
COPY Application/. ./Application/
|
||||
COPY Domain/. ./Domain/
|
||||
COPY Infrastructure/. ./Infrastructure/
|
||||
COPY Apps/Api/. ./Apps/Api/
|
||||
|
||||
WORKDIR /source/Apps/Api
|
||||
RUN dotnet publish -c release -o /app --no-restore
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:5.0
|
||||
WORKDIR /app
|
||||
COPY --from=build /app ./
|
||||
EXPOSE 80
|
||||
ENTRYPOINT ["dotnet", "Api.dll"]
|
||||
Loading…
x
Reference in New Issue
Block a user