-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile-web
More file actions
26 lines (23 loc) · 1.12 KB
/
Dockerfile-web
File metadata and controls
26 lines (23 loc) · 1.12 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
# This stage is used when running from VS in fast mode (Default for Debug configuration)
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS base
RUN apk add tzdata
WORKDIR /app
EXPOSE 8080
ENV ASPNETCORE_URLS=http://*:8080
# This stage is used to build the service project
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
WORKDIR /src
COPY ["book-a-reading-room-visit.web/book-a-reading-room-visit.web.csproj", "book-a-reading-room-visit.web/"]
RUN dotnet restore "book-a-reading-room-visit.web/book-a-reading-room-visit.web.csproj"
COPY . .
WORKDIR "/src/book-a-reading-room-visit.web"
RUN dotnet build "book-a-reading-room-visit.web.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "book-a-reading-room-visit.web.csproj" -c Release -o /app/publish /p:UseAppHost=false
# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration)
FROM base AS final
RUN addgroup -g 965 -S appuser && adduser -u 975 -S -D -h /app appuser appuser
USER appuser
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "book-a-reading-room-visit.web.dll"]