generated from ntxinh/AspNetCore-DDD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (31 loc) · 1.32 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# .NET Core SDK
FROM mcr.microsoft.com/dotnet/core/sdk:6.0-alpine AS build
# Sets the working directory
WORKDIR /app
# Copy Projects
#COPY *.sln .
COPY Src/DDD.Application/DDD.Application.csproj ./Src/DDD.Application/
COPY Src/DDD.Domain/DDD.Domain.csproj ./Src/DDD.Domain/
COPY Src/DDD.Domain.Core/DDD.Domain.Core.csproj ./Src/DDD.Domain.Core/
COPY Src/DDD.Infra.CrossCutting.Bus/DDD.Infra.CrossCutting.Bus.csproj ./Src/DDD.Infra.CrossCutting.Bus/
COPY Src/DDD.Infra.CrossCutting.Identity/DDD.Infra.CrossCutting.Identity.csproj ./Src/DDD.Infra.CrossCutting.Identity/
COPY Src/DDD.Infra.CrossCutting.IoC/DDD.Infra.CrossCutting.IoC.csproj ./Src/DDD.Infra.CrossCutting.IoC/
COPY Src/DDD.Infra.Data/DDD.Infra.Data.csproj ./Src/DDD.Infra.Data/
COPY Src/DDD.Services.Api/DDD.Services.Api.csproj ./Src/DDD.Services.Api/
# .NET Core Restore
RUN dotnet restore ./Src/DDD.Services.Api/DDD.Services.Api.csproj
# Copy All Files
COPY Src ./Src
# .NET Core Build and Publish
RUN dotnet publish ./Src/DDD.Services.Api/DDD.Services.Api.csproj -c Release -o /publish
# ASP.NET Core Runtime
FROM mcr.microsoft.com/dotnet/core/aspnet:6.0-alpine AS runtime
WORKDIR /app
COPY --from=build /publish ./
# Expose ports
EXPOSE 80
EXPOSE 443
# Setup your variables before running.
ARG MyEnv
ENV ASPNETCORE_ENVIRONMENT $MyEnv
ENTRYPOINT ["dotnet", "DDD.Services.Api.dll"]