-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile_TreeNotesService
More file actions
36 lines (27 loc) · 1.27 KB
/
Copy pathDockerfile_TreeNotesService
File metadata and controls
36 lines (27 loc) · 1.27 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
# To mount it open prompt, go to DockerFile_TreeNotesService dir and run this command:
# > docker build -f Dockerfile_TreeNotesService -t treenotes_service .
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
# https://hub.docker.com/_/microsoft-dotnet
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
EXPOSE 80
ENV ASPNETCORE_ENVIRONMENT=Production
ENV ASPNETCORE_URLS=http://+:80
ENV TreeNotesDb__ConnectionString=mongodb://admin:12345678a@localhost:27017
ENV TreeNotesDb__DatabaseName=TreeNotesDb
ENV redis__configuration=localhost:6379
# optionals. Allow different database to users and audit logs
#ENV TreeNotesAuthenticationDb__ConnectionString=mongodb://admin:12345678a@mongodb:27017
#ENV TreeNotesAuthenticationDb__DatabaseName=TreeNotesDb
#ENV AuditDatabase__ConnectionString=mongodb://admin:12345678a@mongodb:27017
#ENV AuditDatabase__DatabaseName=TreeNotesDb
# copy csproj and restore as distinct layers
WORKDIR /source
COPY . ./
WORKDIR /source/Src/01.Presentation/TreeNotes.Service
RUN dotnet build
RUN dotnet publish -c release -o /app --no-restore
# final stage/image
FROM mcr.microsoft.com/dotnet/aspnet:6.0
WORKDIR /app
COPY --from=build /app ./
ENTRYPOINT ["dotnet", "TreeNotes.Service.dll"]