-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
45 lines (37 loc) · 1.98 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
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /app
COPY CDP4Authentication CDP4Authentication
COPY CDP4DatabaseAuthentication CDP4DatabaseAuthentication
COPY CDP4WspDatabaseAuthentication CDP4WspDatabaseAuthentication
COPY CDP4Orm CDP4Orm
COPY VersionFileCreator VersionFileCreator
COPY CometServer CometServer
RUN dotnet build CDP4DatabaseAuthentication -c Release
RUN dotnet build CDP4WspDatabaseAuthentication -c Release
RUN dotnet publish -r linux-x64 CometServer -c Release -o /app/CometServer/bin/Release/publish
FROM mcr.microsoft.com/dotnet/aspnet:8.0.10-alpine3.20
WORKDIR /app
RUN mkdir /app/logs
RUN mkdir /app/storage
RUN mkdir /app/tempstorage
RUN mkdir /app/upload
RUN mkdir /app/Authentication/
RUN mkdir /app/Authentication/CDP4Database
RUN mkdir /app/Authentication/CDP4WspDatabase
RUN mkdir /app/VersionFileCreator
COPY --from=build-env /app/CometServer/bin/Release/publish .
RUN rm /app/appsettings.Development.json
RUN mv /app/appsettings.Production.json /app/appsettings.json
# COPY CDP4DatabaseAuthentication plugin
COPY --from=build-env /app/CDP4DatabaseAuthentication/bin/Release/CDP4DatabaseAuthentication.dll /app/Authentication/CDP4Database/CDP4DatabaseAuthentication.dll
COPY --from=build-env /app/CDP4DatabaseAuthentication/bin/Release/config.json /app/Authentication/CDP4Database/config.json
# COPY CDP4WspDatabaseAuthentication plugin
COPY --from=build-env /app/CDP4WspDatabaseAuthentication/bin/Release/CDP4WspDatabaseAuthentication.dll /app/Authentication/CDP4WspDatabase/CDP4WspDatabaseAuthentication.dll
COPY --from=build-env /app/CDP4WspDatabaseAuthentication/bin/Release/config.json /app/Authentication/CDP4WspDatabase/config.json
COPY --from=build-env /app/VersionFileCreator/bin/Release /app/VersionFileCreator
RUN dotnet /app/VersionFileCreator/VersionFileCreator.dll path:/app
RUN rm -r /app/VersionFileCreator
# set to use the non-root USER here
RUN chown -R $APP_UID /app
USER $APP_UID
CMD ["dotnet", "CometServer.dll"]