## Copyright (C) 2025 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
## See the file COPYING for copying conditions.

[Unit]
Description=docker-entrypoint.service

[Service]
ExecStartPre=/bin/bash -e -x -c "cat -- /etc/docker-entrypoint-cmd"
ExecStart=/bin/bash -e -x -c /etc/docker-entrypoint-cmd
ExecStopPost=/usr/bin/docker-entrypoint-stop.sh
## SilverMetal patches:
##   StandardInput: was `tty-force`. That requires a docker-allocated
##     TTY (`docker run -t`), but we deliberately run without -t in CI
##     so derivative-maker's exception handler stays in non-interactive
##     mode (otherwise any error drops into a `read -p` prompt and the
##     container hangs forever). `null` gives the service /dev/null for
##     stdin — derivative-maker doesn't read stdin during a normal build.
##   StandardOutput / StandardError: keep upstream's `inherit`. With the
##     container running with `-t` (which gives the systemd PID-1 a PTY
##     for fd 1/2), inherit propagates that PTY to the service so its
##     output reaches docker run / the act_runner log. We pair this with
##     StandardInput=null above so derivative-maker's `[ -t 0 ]` returns
##     false and it uses the non-interactive error handler — i.e. we
##     get the visibility benefit of -t without the interactive-prompt
##     hang on errors.
StandardInput=null
StandardOutput=inherit
StandardError=inherit
EnvironmentFile=/etc/docker-entrypoint-env

[Install]
WantedBy=multi-user.target
