Skip to content

Commit 03e8e2e

Browse files
author
Mikhail Libchenko
committed
chore: docker support added
1 parent c7fdb19 commit 03e8e2e

File tree

5 files changed

+76
-76
lines changed

5 files changed

+76
-76
lines changed

.idea/.idea.ASP-Web-API-multi-layer/.idea/.name

Lines changed: 0 additions & 1 deletion
This file was deleted.

.idea/.idea.ASP-Web-API-multi-layer/.idea/workspace.xml

Lines changed: 27 additions & 75 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
2+
WORKDIR /app
3+
EXPOSE 5001
4+
ENV ASPNETCORE_URLS=http://*:5001
5+
6+
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
7+
WORKDIR /src
8+
COPY ["WebApi/WebApi.csproj", "WebApi/"]
9+
COPY ["Domain/Domain.csproj", "Domain/"]
10+
COPY ["DataAccess/DataAccess.csproj", "DataAccess/"]
11+
COPY ["Services/Services.csproj", "Services/"]
12+
RUN dotnet restore "WebApi/WebApi.csproj"
13+
COPY . .
14+
WORKDIR "/src/WebApi"
15+
RUN dotnet build "WebApi.csproj" -c Release -o /app/build
16+
17+
FROM build AS publish
18+
RUN dotnet publish "WebApi.csproj" -c Release -o /app/publish
19+
20+
FROM base AS final
21+
WORKDIR /app
22+
COPY --from=publish /app/publish .
23+
ENTRYPOINT ["dotnet", "WebApi.dll"]

WebApi/.dockerignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**/.dockerignore
2+
**/.env
3+
**/.git
4+
**/.gitignore
5+
**/.project
6+
**/.settings
7+
**/.toolstarget
8+
**/.vs
9+
**/.vscode
10+
**/.idea
11+
**/*.*proj.user
12+
**/*.dbmdl
13+
**/*.jfm
14+
**/azds.yaml
15+
**/bin
16+
**/charts
17+
**/docker-compose*
18+
**/Dockerfile*
19+
**/node_modules
20+
**/npm-debug.log
21+
**/obj
22+
**/secrets.dev.yaml
23+
**/values.dev.yaml
24+
LICENSE
25+
README.md

WebApi/WebApi.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<WarningLevel>5</WarningLevel>
88
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
99
<RootNamespace>WebApi</RootNamespace>
10+
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
1011
</PropertyGroup>
1112

1213
<ItemGroup>

0 commit comments

Comments
 (0)