-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (28 loc) · 1.06 KB
/
Dockerfile
File metadata and controls
41 lines (28 loc) · 1.06 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
# -------- Build Stage --------
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY global.json* ./
COPY osu-performance-server.sln ./
COPY PerformanceServer/PerformanceServer.csproj PerformanceServer/
RUN dotnet restore osu-performance-server.sln
COPY PerformanceServer/ PerformanceServer/
RUN dotnet nuget locals all --clear
ARG PUBLISH_CONFIGURATION=Release
RUN dotnet publish PerformanceServer/PerformanceServer.csproj \
-c $PUBLISH_CONFIGURATION \
-o /app/publish
# -------- Runtime Stage --------
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
WORKDIR /app
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
ENV ASPNETCORE_URLS=http://0.0.0.0:8080 \
SAVE_BEATMAP_FILES=false \
BEATMAPS_PATH=/data/beatmaps \
RULESETS_PATH=/data/rulesets \
MAX_BEATMAP_FILE_SIZE=5242880
VOLUME ["/data"]
COPY --from=build /app/publish .
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD curl http://127.0.0.1:8080 || exit 1
ENTRYPOINT ["dotnet", "PerformanceServer.dll"]