Skip to content

Commit 14b6c18

Browse files
committed
Consolidate dockerfiles
1 parent 5e21305 commit 14b6c18

File tree

6 files changed

+54
-104
lines changed

6 files changed

+54
-104
lines changed

Difficalcy.Catch/Dockerfile

-25
This file was deleted.

Difficalcy.Mania/Dockerfile

-25
This file was deleted.

Difficalcy.Osu/Dockerfile

-25
This file was deleted.

Difficalcy.Taiko/Dockerfile

-25
This file was deleted.

Dockerfile

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
FROM mcr.microsoft.com/dotnet/aspnet:8.0-jammy-chiseled AS base
2+
3+
LABEL org.opencontainers.image.source https://github.com/Syriiin/difficalcy
4+
5+
WORKDIR /app
6+
EXPOSE 80
7+
ENV ASPNETCORE_URLS=http://+:80
8+
ENV ASPNETCORE_ENVIRONMENT=Production
9+
ENV BEATMAP_DIRECTORY=/app/beatmaps
10+
11+
FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build
12+
WORKDIR /src
13+
14+
COPY ./Difficalcy/Difficalcy.csproj ./Difficalcy/
15+
COPY ./Difficalcy.Catch/Difficalcy.Catch.csproj ./Difficalcy.Catch/
16+
COPY ./Difficalcy.Mania/Difficalcy.Mania.csproj ./Difficalcy.Mania/
17+
COPY ./Difficalcy.Osu/Difficalcy.Osu.csproj ./Difficalcy.Osu/
18+
COPY ./Difficalcy.Taiko/Difficalcy.Taiko.csproj ./Difficalcy.Taiko/
19+
20+
RUN dotnet restore ./Difficalcy.Catch/Difficalcy.Catch.csproj
21+
RUN dotnet restore ./Difficalcy.Mania/Difficalcy.Mania.csproj
22+
RUN dotnet restore ./Difficalcy.Osu/Difficalcy.Osu.csproj
23+
RUN dotnet restore ./Difficalcy.Taiko/Difficalcy.Taiko.csproj
24+
25+
COPY ./Difficalcy/ ./Difficalcy/
26+
COPY ./Difficalcy.Catch/ ./Difficalcy.Catch/
27+
COPY ./Difficalcy.Mania/ ./Difficalcy.Mania/
28+
COPY ./Difficalcy.Osu/ ./Difficalcy.Osu/
29+
COPY ./Difficalcy.Taiko/ ./Difficalcy.Taiko/
30+
31+
RUN dotnet publish ./Difficalcy.Catch/Difficalcy.Catch.csproj -o /app/difficalcy-catch --runtime linux-x64 --self-contained false
32+
RUN dotnet publish ./Difficalcy.Mania/Difficalcy.Mania.csproj -o /app/difficalcy-mania --runtime linux-x64 --self-contained false
33+
RUN dotnet publish ./Difficalcy.Osu/Difficalcy.Osu.csproj -o /app/difficalcy-osu --runtime linux-x64 --self-contained false
34+
RUN dotnet publish ./Difficalcy.Taiko/Difficalcy.Taiko.csproj -o /app/difficalcy-taiko --runtime linux-x64 --self-contained false
35+
36+
FROM base AS difficalcy-catch
37+
COPY --from=build /app/difficalcy-catch .
38+
ENTRYPOINT ["dotnet", "Difficalcy.Catch.dll"]
39+
40+
FROM base AS difficalcy-mania
41+
COPY --from=build /app/difficalcy-mania .
42+
ENTRYPOINT ["dotnet", "Difficalcy.Mania.dll"]
43+
44+
FROM base AS difficalcy-osu
45+
COPY --from=build /app/difficalcy-osu .
46+
ENTRYPOINT ["dotnet", "Difficalcy.Osu.dll"]
47+
48+
FROM base AS difficalcy-taiko
49+
COPY --from=build /app/difficalcy-taiko .
50+
ENTRYPOINT ["dotnet", "Difficalcy.Taiko.dll"]

docker-compose.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ services:
22
difficalcy-osu:
33
build:
44
context: .
5-
dockerfile: ./Difficalcy.Osu/Dockerfile
5+
target: difficalcy-osu
66
environment:
77
- REDIS_CONFIGURATION=cache:6379
88
volumes:
@@ -13,7 +13,7 @@ services:
1313
difficalcy-taiko:
1414
build:
1515
context: .
16-
dockerfile: ./Difficalcy.Taiko/Dockerfile
16+
target: difficalcy-taiko
1717
environment:
1818
- REDIS_CONFIGURATION=cache:6379
1919
volumes:
@@ -24,7 +24,7 @@ services:
2424
difficalcy-catch:
2525
build:
2626
context: .
27-
dockerfile: ./Difficalcy.Catch/Dockerfile
27+
target: difficalcy-catch
2828
environment:
2929
- REDIS_CONFIGURATION=cache:6379
3030
volumes:
@@ -35,7 +35,7 @@ services:
3535
difficalcy-mania:
3636
build:
3737
context: .
38-
dockerfile: ./Difficalcy.Mania/Dockerfile
38+
target: difficalcy-mania
3939
environment:
4040
- REDIS_CONFIGURATION=cache:6379
4141
volumes:

0 commit comments

Comments
 (0)