fix: add docker-entrypoint.sh to fix bind-mount permissions on clean installs

This commit is contained in:
SW 2026-10-01 14:37:17 +02:00
parent d59de720c5
commit 406ff2f9c2
2 changed files with 12 additions and 3 deletions

View file

@ -31,12 +31,12 @@ COPY --from=builder /app/target/release/sub-aligator /usr/local/bin/sub-aligator
COPY --from=builder /app/migrations /app/migrations
COPY --from=builder /app/static /app/static
COPY --from=builder /app/templates /app/templates
USER app
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD curl -fsS http://localhost:8080/healthz >/dev/null || exit 1
CMD ["/usr/local/bin/sub-aligator"]
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]

9
docker-entrypoint.sh Normal file
View file

@ -0,0 +1,9 @@
#!/bin/sh
set -e
# Ensure persistent directories exist and are writable by the app user.
mkdir -p /app/data /app/exports /app/backups
chown -R app:app /app/data /app/exports /app/backups
# Drop root privileges and run the application as the app user.
exec runuser -u app -- /usr/local/bin/sub-aligator "$@"