Skip to content

Commit

Permalink
fix: fixed "Failed to connect to socket /run/dbus/system_bus_socket: …
Browse files Browse the repository at this point in the history
…No such file or directory"

Refs: #60
  • Loading branch information
grigoriev committed Sep 18, 2024
1 parent cc9cdb2 commit d0c640f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ LABEL maintainer="SBB Polarion Team <polarion-opensource@sbb.ch>"
ARG APP_IMAGE_VERSION

RUN apt-get update && \
apt-get --yes --no-install-recommends install chromium fonts-dejavu fonts-liberation libpango-1.0-0 libpangoft2-1.0-0 python3-brotli python3-cffi && \
apt-get --yes --no-install-recommends install chromium dbus fonts-dejavu fonts-liberation libpango-1.0-0 libpangoft2-1.0-0 python3-brotli python3-cffi vim && \
apt-get clean autoclean && \
apt-get --yes autoremove && \
rm -rf /var/lib/apt/lists/*
Expand All @@ -21,4 +21,7 @@ RUN pip install --no-cache-dir -r ${WORKING_DIR}/requirements.txt

COPY ./app/*.py ${WORKING_DIR}/app/

ENTRYPOINT [ "python", "app/WeasyprintServiceApplication.py" ]
COPY entrypoint.sh ${WORKING_DIR}/entrypoint.sh
RUN chmod +x ${WORKING_DIR}/entrypoint.sh

ENTRYPOINT [ "./entrypoint.sh" ]
14 changes: 14 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

if ! pgrep -x 'dbus-daemon' > /dev/null; then
if [ -f /run/dbus/pid ]; then
rm /run/dbus/pid
fi
dbus-daemon --system --fork;
fi

python app/WeasyprintServiceApplication.py &

wait -n

exit $?

0 comments on commit d0c640f

Please sign in to comment.