Skip to content

Commit

Permalink
Pre-extract archive in CI/CD before Dockerfile.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbound committed Apr 28, 2023
1 parent 1a295a9 commit 172a80a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
4 changes: 2 additions & 2 deletions Agent/Services/Windows/AppLauncherWin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ await hubConnection.SendAsync("DisplayMessage",

// Start Desktop app.
await hubConnection.SendAsync("DisplayMessage",
"Starting remote control.",
"Starting remote control.",
"Starting remote control",
"Starting remote control",
"bg-success",
userConnectionId);
if (WindowsIdentity.GetCurrent().IsSystem)
Expand Down
26 changes: 6 additions & 20 deletions Server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
FROM mcr.microsoft.com/dotnet/aspnet:7.0-jammy AS setup

WORKDIR /src

COPY /_immense.Remotely/Server/DockerMain.sh .
COPY /_immense.Remotely/Server/linux-x64/Server.zip .

RUN \
apt-get -y update && \
apt-get -y install unzip && \
unzip -o ./Server.zip -d /app && \
rm ./Server.zip


FROM setup AS execute
FROM mcr.microsoft.com/dotnet/aspnet:7.0-jammy

SHELL ["/bin/bash", "-c"]

Expand All @@ -21,17 +7,17 @@ EXPOSE 5000
ENV ASPNETCORE_ENVIRONMENT="Production"
ENV ASPNETCORE_URLS="http://*:5000"

COPY /_immense.Remotely/Server/DockerMain.sh .
COPY /_immense.Remotely/Server/linux-x64/Server /app

WORKDIR /app

RUN \
mkdir -p /remotely-data && \
sed -i 's/DataSource=Remotely.db/DataSource=\/remotely-data\/Remotely.db/' ./appsettings.json
sed -i 's/DataSource=Remotely.db/DataSource=\/remotely-data\/Remotely.db/' /app/appsettings.json

VOLUME "/remotely-data"

RUN chmod +x "/src/DockerMain.sh"

ENTRYPOINT ["/src/DockerMain.sh"]

HEALTHCHECK --interval=5m --timeout=3s \
CMD curl -f http://localhost:5000/ || exit 1
ENTRYPOINT ["/src/DockerMain.sh"]

0 comments on commit 172a80a

Please sign in to comment.