-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathDockerfile-TechTalksMQProducer
36 lines (24 loc) · 1.02 KB
/
Dockerfile-TechTalksMQProducer
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
#FROM mcr.microsoft.com/dotnet/core/sdk:3.0 AS build-env
#FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build-env
# FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build-env
# FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine AS build-env
FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine AS build-env
WORKDIR /app
COPY TechTalksMQProducer /TechTalksMQProducer/
COPY TechTalksModel /TechTalksModel/
# COPY NuGet.config ./
WORKDIR /TechTalksMQProducer
RUN dotnet restore
#COPY . ./
RUN dotnet publish --configuration Release --output releaseOutput --no-restore
#build runtime image
#FROM mcr.microsoft.com/dotnet/core/aspnet:3.0
#FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim
# FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim
# FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine
FROM mcr.microsoft.com/dotnet/aspnet:7.0-alpine
WORKDIR /TechTalksMQProducer
COPY --from=build-env /TechTalksMQProducer/releaseOutput ./
#run the container as non-root user
#USER 1000
ENTRYPOINT ["dotnet", "TechTalksMQProducer.dll"]