-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
61 lines (48 loc) · 2.62 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine3.19 AS base
LABEL org.opencontainers.image.source https://github.com/Syriiin/difficalcy
WORKDIR /app
EXPOSE 80
ENV ASPNETCORE_URLS="http://+:80"
ENV ASPNETCORE_ENVIRONMENT="Production"
ENV BEATMAP_DIRECTORY="/beatmaps"
ENV DOWNLOAD_MISSING_BEATMAPS="true"
VOLUME ${BEATMAP_DIRECTORY}
# chmod 777 so that this volume can be read/written by other containers that might use different uids
RUN mkdir ${BEATMAP_DIRECTORY} && chmod -R 777 ${BEATMAP_DIRECTORY}
USER app
FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build
WORKDIR /src
COPY ./Difficalcy/Difficalcy.csproj ./Difficalcy/
COPY ./Difficalcy.Catch/Difficalcy.Catch.csproj ./Difficalcy.Catch/
COPY ./Difficalcy.Mania/Difficalcy.Mania.csproj ./Difficalcy.Mania/
COPY ./Difficalcy.Osu/Difficalcy.Osu.csproj ./Difficalcy.Osu/
COPY ./Difficalcy.Taiko/Difficalcy.Taiko.csproj ./Difficalcy.Taiko/
RUN dotnet restore ./Difficalcy.Catch/Difficalcy.Catch.csproj
RUN dotnet restore ./Difficalcy.Mania/Difficalcy.Mania.csproj
RUN dotnet restore ./Difficalcy.Osu/Difficalcy.Osu.csproj
RUN dotnet restore ./Difficalcy.Taiko/Difficalcy.Taiko.csproj
COPY ./Difficalcy/ ./Difficalcy/
COPY ./Difficalcy.Catch/ ./Difficalcy.Catch/
COPY ./Difficalcy.Mania/ ./Difficalcy.Mania/
COPY ./Difficalcy.Osu/ ./Difficalcy.Osu/
COPY ./Difficalcy.Taiko/ ./Difficalcy.Taiko/
RUN dotnet publish ./Difficalcy.Catch/Difficalcy.Catch.csproj -o /app/difficalcy-catch --runtime linux-musl-x64 --self-contained false
RUN dotnet publish ./Difficalcy.Mania/Difficalcy.Mania.csproj -o /app/difficalcy-mania --runtime linux-musl-x64 --self-contained false
RUN dotnet publish ./Difficalcy.Osu/Difficalcy.Osu.csproj -o /app/difficalcy-osu --runtime linux-musl-x64 --self-contained false
RUN dotnet publish ./Difficalcy.Taiko/Difficalcy.Taiko.csproj -o /app/difficalcy-taiko --runtime linux-musl-x64 --self-contained false
FROM base AS difficalcy-catch
LABEL org.opencontainers.image.description "Lazer powered osu!catch difficulty calculator API"
COPY --from=build /app/difficalcy-catch .
ENTRYPOINT ["./Difficalcy.Catch"]
FROM base AS difficalcy-mania
LABEL org.opencontainers.image.description "Lazer powered osu!mania difficulty calculator API"
COPY --from=build /app/difficalcy-mania .
ENTRYPOINT ["./Difficalcy.Mania"]
FROM base AS difficalcy-osu
LABEL org.opencontainers.image.description "Lazer powered osu! difficulty calculator API"
COPY --from=build /app/difficalcy-osu .
ENTRYPOINT ["./Difficalcy.Osu"]
FROM base AS difficalcy-taiko
LABEL org.opencontainers.image.description "Lazer powered osu!taiko difficulty calculator API"
COPY --from=build /app/difficalcy-taiko .
ENTRYPOINT ["./Difficalcy.Taiko"]