forked from nuyonu/N-Tier-Architecture
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds dockerfile and docker-compose
closes nuyonu#53
- Loading branch information
Showing
11 changed files
with
97 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base | ||
WORKDIR /app | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build | ||
WORKDIR /src | ||
|
||
COPY ["./src/N-Tier.API/N-Tier.API.csproj", "src/N-Tier.API/"] | ||
COPY ["./src/N-Tier.Application/N-Tier.Application.csproj", "src/N-Tier.Application/"] | ||
COPY ["./src/N-Tier.Core/N-Tier.Core.csproj", "src/N-Tier.Core/"] | ||
COPY ["./src/N-Tier.DataAccess/N-Tier.DataAccess.csproj", "src/N-Tier.DataAccess/"] | ||
COPY ["./src/N-Tier.Shared/N-Tier.Shared.csproj", "src/N-Tier.Shared/"] | ||
|
||
RUN dotnet restore "src/N-Tier.API/N-Tier.API.csproj" | ||
|
||
COPY . . | ||
|
||
WORKDIR "src/N-Tier.API/" | ||
RUN dotnet build -c Release -o /app/build | ||
|
||
FROM build AS publish | ||
RUN dotnet publish -c Release -o /app/publish | ||
|
||
FROM base AS runtime | ||
WORKDIR /app | ||
|
||
COPY --from=publish /app/publish . | ||
|
||
ENTRYPOINT [ "dotnet", "N-Tier.API.dll" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version: "3.9" | ||
services: | ||
db: | ||
image: "mcr.microsoft.com/mssql/server" | ||
environment: | ||
SA_PASSWORD: "Admin123.?" | ||
ACCEPT_EULA: "Y" | ||
web: | ||
build: . | ||
ports: | ||
- "5000:80" | ||
depends_on: | ||
- db | ||
environment: | ||
ASPNETCORE_ENVIRONMENT: "Production" | ||
CONNECTION_STRING: "Server=db;Database=NTier;User=sa;Password=Admin123.?;" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace N_Tier.API.Controllers; | ||
|
||
public class HealthcheckController : ApiController | ||
{ | ||
[HttpGet] | ||
public IActionResult Get() | ||
{ | ||
return Ok(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace N_Tier.DataAccess; | ||
|
||
public class DatabaseConfiguration | ||
{ | ||
public bool UseInMemoryDatabase { get; set; } | ||
|
||
public string ConnectionString { get; set; } | ||
} |