From 417792a7c1ae6a58ee88bae338710f1d8aae3b8b Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Wed, 21 Feb 2024 14:14:23 -0800 Subject: [PATCH] Add restart policy. Use ASPNETCORE port variable. --- Server/Dockerfile | 6 +----- Server/Dockerfile.pipelines | 6 +----- docker-compose/docker-compose.yml | 1 + 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/Server/Dockerfile b/Server/Dockerfile index f406f543..cdb3fc2a 100644 --- a/Server/Dockerfile +++ b/Server/Dockerfile @@ -3,15 +3,11 @@ FROM mcr.microsoft.com/dotnet/aspnet:8.0 EXPOSE ${ASPNETCORE_HTTP_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 -USER app ENTRYPOINT ["dotnet", "Remotely_Server.dll"] HEALTHCHECK --interval=5m --timeout=3s \ - CMD curl -f http://localhost:5000/api/healthcheck || exit 1 \ No newline at end of file + CMD curl -f http://localhost:${ASPNETCORE_HTTP_PORTS}/api/healthcheck || exit 1 \ No newline at end of file diff --git a/Server/Dockerfile.pipelines b/Server/Dockerfile.pipelines index d8e168d0..8590ecbd 100644 --- a/Server/Dockerfile.pipelines +++ b/Server/Dockerfile.pipelines @@ -3,15 +3,11 @@ FROM mcr.microsoft.com/dotnet/aspnet:8.0 EXPOSE ${ASPNETCORE_HTTP_PORTS} RUN apt -y update && apt -y install curl -RUN mkdir -p /app/AppData -RUN chown app:app -R /app/AppData - COPY /_immense.Remotely/Server/linux-x64/Server /app WORKDIR /app -USER app ENTRYPOINT ["dotnet", "Remotely_Server.dll"] HEALTHCHECK --interval=5m --timeout=3s \ - CMD curl -f http://localhost:5000/api/healthcheck || exit 1 \ No newline at end of file + CMD curl -f http://localhost:${ASPNETCORE_HTTP_PORTS}/api/healthcheck || exit 1 \ No newline at end of file diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml index c38ba0b6..872c0771 100644 --- a/docker-compose/docker-compose.yml +++ b/docker-compose/docker-compose.yml @@ -5,6 +5,7 @@ services: image: immybot/remotely:latest volumes: - /var/www/remotely:/app/AppData + restart: unless-stopped ports: - "5000:5000" environment: