feat: add Docker support with environment configuration and entrypoint script

This commit is contained in:
HueByte
2026-02-22 18:12:06 +01:00
parent 039390c8b0
commit 45fd382b13
7 changed files with 197 additions and 7 deletions
+3 -1
View File
@@ -23,6 +23,8 @@ RUN groupadd -r echohub && useradd -r -g echohub -d /app echohub \
&& chown -R echohub:echohub /app
COPY --from=build --chown=echohub:echohub /app/publish .
COPY --chown=echohub:echohub EchoHub.Server/docker-entrypoint.sh /app/docker-entrypoint.sh
RUN chmod +x /app/docker-entrypoint.sh
USER echohub
@@ -34,4 +36,4 @@ ENV ASPNETCORE_ENVIRONMENT=Production \
EXPOSE 5000 6667 6697
ENTRYPOINT ["dotnet", "EchoHub.Server.dll"]
ENTRYPOINT ["/app/docker-entrypoint.sh"]
+10
View File
@@ -0,0 +1,10 @@
#!/bin/sh
# Persist appsettings.json in the data volume so auto-generated keys
# (JWT secret, encryption key) survive container recreation.
if [ ! -f /app/data/appsettings.json ]; then
cp /app/appsettings.example.json /app/data/appsettings.json
fi
ln -sf /app/data/appsettings.json /app/appsettings.json
exec dotnet EchoHub.Server.dll