-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (43 loc) · 1.34 KB
/
Copy pathDockerfile
File metadata and controls
58 lines (43 loc) · 1.34 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
gpg \
&& rm -rf /var/lib/apt/lists/*
EXPOSE 5000
EXPOSE 5001
EXPOSE 8080
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
ARG Configuration=Release
WORKDIR /src
# Restore
COPY ./Streetcode/*.sln ./
COPY ./Streetcode/Streetcode.WebApi/*.csproj ./Streetcode.WebApi/
COPY ./Streetcode/Streetcode.BLL/*.csproj ./Streetcode.BLL/
COPY ./Streetcode/Streetcode.DAL/*.csproj ./Streetcode.DAL/
COPY ./Streetcode/Streetcode.EmailService/*.csproj ./Streetcode.EmailService/
COPY ./Streetcode/DbUpdate/*.csproj ./DbUpdate/
COPY ./Streetcode/Streetcode.XUnitTest/*.csproj ./Streetcode.XUnitTest/
COPY ./Streetcode/Streetcode.XIntegrationTest/*.csproj ./Streetcode.XIntegrationTest/
COPY ./houses.zip ./
RUN dotnet restore Streetcode.WebApi/Streetcode.WebApi.csproj
# Build
COPY ./Streetcode/ ./
RUN dotnet build \
Streetcode.WebApi/Streetcode.WebApi.csproj \
-c "$Configuration" \
--no-restore
# Publish
FROM build AS publish
RUN dotnet publish \
Streetcode.WebApi/Streetcode.WebApi.csproj \
-c "$Configuration" \
-o /app/publish \
--no-build
# Runtime
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
LABEL atom="Streetcode"
ENTRYPOINT ["dotnet", "Streetcode.WebApi.dll"]