mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Fix server logs.
This commit is contained in:
parent
f2d0ca68fe
commit
c2d53db92b
@ -192,7 +192,8 @@ jobs:
|
||||
targetType: inline
|
||||
script: |
|
||||
Copy-Item -Path "$(Build.SourcesDirectory)\Server\Dockerfile" -Destination "$(build.artifactstagingdirectory)\Dockerfile"
|
||||
Copy-Item -Path "$(Build.SourcesDirectory)\Server\DockerMain.sh" -Destination "$(build.artifactstagingdirectory)\DockerMain.sh"
|
||||
Copy-Item -Path "$(Build.SourcesDirectory)\docker-compose\docker-compose.yml" -Destination "$(build.artifactstagingdirectory)\docker-compose.yml"
|
||||
Copy-Item -Path "$(Build.SourcesDirectory)\docker-compose\docker-compose-compat.yml" -Destination "$(build.artifactstagingdirectory)\docker-compose-compat.yml"
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: Publish Artifact
|
||||
|
||||
@ -1,37 +1,15 @@
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0
|
||||
|
||||
EXPOSE ${ASPNETCORE_HTTP_PORTS}
|
||||
EXPOSE ${ASPNETCORE_HTTPS_PORTS}
|
||||
|
||||
RUN apt -y update && apt -y install curl
|
||||
RUN mkdir -p /app/AppData
|
||||
RUN chown app:app -R /app/AppData
|
||||
|
||||
COPY Server/bin/publish /app
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
COPY ["Directory.Build.props", "."]
|
||||
COPY ["Server/Server.csproj", "Server/"]
|
||||
COPY ["Shared/Shared.csproj", "Shared/"]
|
||||
COPY ["submodules/Immense.RemoteControl/Immense.RemoteControl.Shared/Immense.RemoteControl.Shared.csproj", "submodules/Immense.RemoteControl/Immense.RemoteControl.Shared/"]
|
||||
COPY ["submodules/Immense.RemoteControl/Immense.RemoteControl.Server/Immense.RemoteControl.Server.csproj", "submodules/Immense.RemoteControl/Immense.RemoteControl.Server/"]
|
||||
RUN dotnet restore "./Server/./Server.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/Server"
|
||||
|
||||
RUN dotnet build "./Server.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
RUN dotnet publish "./Server.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
|
||||
USER app
|
||||
ENTRYPOINT ["dotnet", "Remotely_Server.dll"]
|
||||
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0
|
||||
|
||||
EXPOSE ${ASPNETCORE_HTTP_PORTS}
|
||||
EXPOSE ${ASPNETCORE_HTTPS_PORTS}
|
||||
|
||||
RUN apt -y update && apt -y install curl
|
||||
RUN mkdir -p /app/AppData
|
||||
|
||||
@ -46,11 +46,11 @@ public class LogsManager : ILogsManager
|
||||
{
|
||||
get
|
||||
{
|
||||
var logsDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "logs");
|
||||
if (Directory.Exists("/remotely-data"))
|
||||
{
|
||||
logsDir = "/remotely-data/logs";
|
||||
}
|
||||
var logsDir = Path.Combine(
|
||||
AppDomain.CurrentDomain.BaseDirectory,
|
||||
"AppData",
|
||||
"logs");
|
||||
|
||||
return logsDir;
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,11 +17,9 @@ services:
|
||||
dockerfile: Server/Dockerfile
|
||||
ports:
|
||||
- "5000:5000"
|
||||
- "5001:5001"
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Production
|
||||
- ASPNETCORE_HTTP_PORTS=5000
|
||||
- ASPNETCORE_HTTPS_PORTS=5001
|
||||
# Other ASP.NET Core configurations can be overridden here, such as Logging.
|
||||
# See https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-8.0
|
||||
|
||||
|
||||
@ -1,9 +1,5 @@
|
||||
version: '3.4'
|
||||
|
||||
volumes:
|
||||
remotely-data:
|
||||
name: remotely-data
|
||||
|
||||
|
||||
services:
|
||||
remotely:
|
||||
@ -16,4 +12,7 @@ services:
|
||||
- "5001:5001"
|
||||
volumes:
|
||||
- ${APPDATA}/Microsoft/UserSecrets:/home/app/.microsoft/usersecrets:ro
|
||||
- ${APPDATA}/ASP.NET/Https:/home/app/.aspnet/https:ro
|
||||
- ${APPDATA}/ASP.NET/Https:/home/app/.aspnet/https:ro
|
||||
build:
|
||||
context: ../
|
||||
dockerfile: Server/Dockerfile
|
||||
@ -9,16 +9,11 @@ services:
|
||||
image: immybot/remotely:latest
|
||||
volumes:
|
||||
- remotely-data:/app/AppData
|
||||
build:
|
||||
context: ../
|
||||
dockerfile: Server/Dockerfile
|
||||
ports:
|
||||
- "5000:5000"
|
||||
- "5001:5001"
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Production
|
||||
- ASPNETCORE_HTTP_PORTS=5000
|
||||
- ASPNETCORE_HTTPS_PORTS=5001
|
||||
# Other ASP.NET Core configurations can be overridden here, such as Logging.
|
||||
# See https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-8.0
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user