-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
42 lines (32 loc) · 1.19 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
41
42
ARG VERSION=6.0-focal
FROM mcr.microsoft.com/dotnet/sdk:$VERSION AS build-env
WORKDIR /app
ADD *.sln .
ADD PlutoDAO.Gov.Application/*.csproj ./PlutoDAO.Gov.Application/
ADD PlutoDAO.Gov.Domain/*.csproj ./PlutoDAO.Gov.Domain/
ADD PlutoDAO.Gov.Infrastructure/*.csproj ./PlutoDAO.Gov.Infrastructure/
ADD PlutoDAO.Gov.Test/*.csproj ./PlutoDAO.Gov.Test/
ADD PlutoDAO.Gov.Test.Integration/*.csproj ./PlutoDAO.Gov.Test.Integration/
ADD PlutoDAO.Gov.WebApi/*.csproj ./PlutoDAO.Gov.WebApi/
RUN dotnet restore
ADD PlutoDAO.Gov.Application/. ./PlutoDAO.Gov.Application/
ADD PlutoDAO.Gov.Domain/. ./PlutoDAO.Gov.Domain/
ADD PlutoDAO.Gov.Infrastructure/. ./PlutoDAO.Gov.Infrastructure/
ADD PlutoDAO.Gov.WebApi/. ./PlutoDAO.Gov.WebApi/
WORKDIR /app/PlutoDAO.Gov.WebApi
RUN dotnet publish \
-c Release \
-o ./output
FROM mcr.microsoft.com/dotnet/aspnet:$VERSION AS runtime
RUN adduser \
--disabled-password \
--home /app \
--gecos '' app \
&& chown -R app /app
USER app
WORKDIR /app
COPY --from=build-env /app/PlutoDAO.Gov.WebApi/output .
ENV DOTNET_RUNNING_IN_CONTAINER=true \
ASPNETCORE_URLS=http://+:8080
EXPOSE 8080
ENTRYPOINT ["dotnet", "PlutoDAO.Gov.WebApi.dll"]