Improve docker args

This commit is contained in:
JustArchi 2017-10-08 15:08:15 +02:00
parent ad2c45adb6
commit f210499874
4 changed files with 12 additions and 3 deletions

View file

@ -6,9 +6,14 @@ if [[ -z "${ASF_ARGS-}" ]]; then
ASF_ARGS=""
fi
for ARG in "$@"; do
ASF_ARGS+=" $ARG"
done
# Kill underlying ASF process on shell process exit
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
while [[ -f ArchiSteamFarm.dll ]]; do
dotnet ArchiSteamFarm.dll --service $ASF_ARGS # We will abort the script if ASF exits with an error
dotnet ArchiSteamFarm.dll $ASF_ARGS # We will abort the script if ASF exits with an error
sleep 1
done

View file

@ -6,5 +6,9 @@ if [[ -z "${ASF_ARGS-}" ]]; then
ASF_ARGS=""
fi
for ARG in "$@"; do
ASF_ARGS+=" $ARG"
done
# We don't need our shell anymore, just replace the current process instead of starting a new one
exec dotnet ArchiSteamFarm.dll $ASF_ARGS

View file

@ -7,4 +7,4 @@ RUN dotnet publish ArchiSteamFarm -c Release -o out /nologo && \
FROM microsoft/dotnet:2.0-runtime
WORKDIR /app
COPY --from=build-env /app/ArchiSteamFarm/out ./
ENTRYPOINT ["./ArchiSteamFarm.sh"]
ENTRYPOINT ["./ArchiSteamFarm.sh", "--service"]

View file

@ -8,4 +8,4 @@ RUN dotnet publish ArchiSteamFarm -c Release -o out /nologo && \
FROM microsoft/dotnet:2.0-runtime
WORKDIR /app
COPY --from=build-env /app/ArchiSteamFarm/out ./
ENTRYPOINT ["./ArchiSteamFarm-Service.sh"]
ENTRYPOINT ["./ArchiSteamFarm-Service.sh", "--service"]