-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
28 lines (25 loc) · 923 Bytes
/
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
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["SS14.MapServer/SS14.MapServer.csproj", "SS14.MapServer/"]
RUN dotnet restore "SS14.MapServer/SS14.MapServer.csproj"
COPY . .
WORKDIR "/src/SS14.MapServer"
RUN dotnet build "SS14.MapServer.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "SS14.MapServer.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
ENV DOTNET_ENVIRONMENT=Production
ENV ASPNETCORE_ENVIRONMENT=Production
ENV ASPNETCORE_URLS=http://*:80
COPY --from=publish /app/publish .
COPY ./SS14.MapServer/appsettings.yaml .
COPY ./SS14.MapServer/appsettings.Production.yaml .
RUN apt-get update -y && apt-get -y install procps libfreetype6
RUN mkdir /app/build
RUN chown -R 20202:20202 /app
USER 20202:20202
ENTRYPOINT ["dotnet", "SS14.MapServer.dll", "--environment=Production"]