fix: add docker-entrypoint.sh to fix bind-mount permissions on clean installs
This commit is contained in:
parent
d59de720c5
commit
406ff2f9c2
2 changed files with 12 additions and 3 deletions
|
|
@ -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
9
docker-entrypoint.sh
Normal 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 "$@"
|
||||
Loading…
Add table
Reference in a new issue