fix Fatturazione elettronica XML previe
This commit is contained in:
48
Dockerfile
48
Dockerfile
@@ -21,8 +21,12 @@ RUN apt-get update && \
|
||||
libcups2 libnss3 \
|
||||
inotify-tools gosu \
|
||||
openbox \
|
||||
dbus-user-session \
|
||||
mousepad \
|
||||
x11-xserver-utils xauth \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
# Install Windows-like themes
|
||||
RUN apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
@@ -48,6 +52,9 @@ COPY --chown=abc:abc Fiscality /app/Fiscality
|
||||
RUN chmod -R a+rwX /app/Fiscality \
|
||||
&& chmod a+x /app/Fiscality/Fiscality
|
||||
|
||||
# Symlink JRE so it's accessible from /config/jre
|
||||
RUN mkdir -p /config && ln -s /app/Fiscality/jre /config/jre
|
||||
|
||||
# cont-init script to fix ownership at container start
|
||||
RUN mkdir -p /etc/cont-init.d && \
|
||||
cat > /etc/cont-init.d/99-fix-perms <<'EOF'
|
||||
@@ -61,6 +68,7 @@ chown -R abc:abc /config/FiscalityMio 2>/dev/null || true
|
||||
EOF
|
||||
RUN chmod +x /etc/cont-init.d/99-fix-perms
|
||||
|
||||
|
||||
# Override xdg-open to use Firefox for PDFs
|
||||
RUN if [ -f /usr/bin/xdg-open ]; then mv /usr/bin/xdg-open /usr/bin/xdg-open.real; fi
|
||||
|
||||
@@ -105,8 +113,8 @@ case "${ARG,,}" in
|
||||
fi
|
||||
exit 0
|
||||
;;
|
||||
*.xml|*.txt|*.wri)
|
||||
# Open text files with Firefox
|
||||
*.xml|*.txt|*.wri)
|
||||
# Open .xml and .txt files with Firefox
|
||||
if command -v gosu >/dev/null 2>&1; then
|
||||
gosu abc env MOZ_DISABLE_CONTENT_SANDBOX=1 MOZ_DISABLE_GMP_SANDBOX=1 \
|
||||
DISPLAY="${DISPLAY:-:1}" \
|
||||
@@ -120,20 +128,6 @@ case "${ARG,,}" in
|
||||
fi
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
if [ -x /usr/bin/xdg-open.real ]; then
|
||||
exec /usr/bin/xdg-open.real "$@"
|
||||
else
|
||||
if command -v gosu >/dev/null 2>&1; then
|
||||
gosu abc env MOZ_DISABLE_CONTENT_SANDBOX=1 DISPLAY="${DISPLAY:-:1}" \
|
||||
nohup firefox --no-remote "file://${ARG}" >/dev/null 2>&1 &
|
||||
else
|
||||
su -s /bin/bash abc -c "env MOZ_DISABLE_CONTENT_SANDBOX=1 DISPLAY='${DISPLAY:-:1}' \
|
||||
nohup firefox --no-remote 'file://${ARG}' >/dev/null 2>&1 &" || true
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
EOF
|
||||
|
||||
@@ -185,7 +179,27 @@ RUN chmod +x /defaults/autostart
|
||||
# Set environment and entrypoint
|
||||
ENV GTK_USE_PORTAL=1
|
||||
ENV TITLE="Fiscality"
|
||||
ENV NO_FULL=true
|
||||
EXPOSE 3000
|
||||
|
||||
USER root
|
||||
ENTRYPOINT ["/init"]
|
||||
|
||||
# Create the entrypoint script at build time. Quoted EOF prevents build-time expansion.
|
||||
RUN cat > /entrypoint.sh <<'EOF'
|
||||
#!/bin/bash
|
||||
set -e
|
||||
# Fix permissions on mounted volumes
|
||||
chmod -R 775 /app 2>/dev/null || true
|
||||
chmod -R 775 /config 2>/dev/null || true
|
||||
# Also fix ownership to match PUID/PGID (expanded at runtime)
|
||||
chown -R ${PUID:-1000}:${PGID:-1000} /app 2>/dev/null || true
|
||||
chown -R ${PUID:-1000}:${PGID:-1000} /config 2>/dev/null || true
|
||||
# Execute the original command
|
||||
exec "$@"
|
||||
EOF
|
||||
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
# Set entrypoint and default cmd
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
CMD ["/init"]
|
||||
Reference in New Issue
Block a user