mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-04 08:36:11 +02:00
feat: add Docker support with environment configuration and entrypoint script
This commit is contained in:
@@ -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"]
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user