feat: add Nomad run script
This commit is contained in:
parent
9314ce672a
commit
8e5b987b2c
@ -8,6 +8,7 @@
|
||||
!nuget.config
|
||||
!.git
|
||||
!proto
|
||||
!scripts/run-clustered.sh
|
||||
|
||||
# Re-exclude host build artifact directories
|
||||
**/bin
|
||||
|
@ -1,4 +1,5 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Restore/fetch dependencies excluding app code to make use of caching
|
||||
@ -24,6 +25,10 @@ LABEL org.opencontainers.image.source = "https://github.com/xSke/PluralKit"
|
||||
WORKDIR /app
|
||||
COPY --from=build /app ./
|
||||
|
||||
# Runtime dependency in prod
|
||||
RUN apt update && apt install -y curl
|
||||
ADD scripts/run-clustered.sh /
|
||||
|
||||
# Allow overriding CMD from eg. docker-compose to run API layer too
|
||||
ENTRYPOINT ["dotnet"]
|
||||
CMD ["bin/PluralKit.Bot.dll"]
|
||||
|
15
scripts/run-clustered.sh
Executable file
15
scripts/run-clustered.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
notify () {
|
||||
curl http://172.17.0.1:8081/notify -d "$1"
|
||||
}
|
||||
|
||||
curl http://172.17.0.1:8081/config > pluralkit.conf
|
||||
|
||||
notify "Cluster $NOMAD_ALLOC_INDEX starting"
|
||||
|
||||
export PluralKit__Bot__Cluster__NodeName="pluralkit-$NOMAD_ALLOC_INDEX"
|
||||
|
||||
dotnet bin/PluralKit.Bot.dll
|
||||
|
||||
notify "Cluster $NOMAD_ALLOC_INDEX exited with code $?"
|
Loading…
Reference in New Issue
Block a user