feature(entrypoint): use entrypoint script to launch cmd
- allows preservation of ctrl-c termination - 'shell' command as proxy for /bin/bash
This commit is contained in:
parent
8aae6c877f
commit
dce4cf6ef7
@ -53,10 +53,14 @@ ENV PATH=$PATH:/opt/dart-sass
|
|||||||
ENV TZ=Etc/UTC
|
ENV TZ=Etc/UTC
|
||||||
ENV SASS_STYLE=compressed
|
ENV SASS_STYLE=compressed
|
||||||
|
|
||||||
|
# copy scripts and set permissions
|
||||||
|
COPY [ "entrypoint.sh", "/usr/local/bin/entrypoint.sh" ]
|
||||||
|
RUN chown root:root /usr/local/bin/entrypoint.sh \
|
||||||
|
&& chmod 755 /usr/local/bin/entrypoint.sh
|
||||||
|
|
||||||
# switch to user account and run sass compiler
|
# switch to user account and run sass compiler
|
||||||
USER sass
|
USER sass
|
||||||
ENTRYPOINT [ "/usr/bin/tini", "--" ]
|
ENTRYPOINT [ "/usr/bin/tini", "--", "/usr/local/bin/entrypoint.sh" ]
|
||||||
CMD /opt/dart-sass/sass -s ${SASS_STYLE} --watch --poll --stop-on-error /sass:/css
|
|
||||||
|
|
||||||
# set build timestamp, git and version labels
|
# set build timestamp, git and version labels
|
||||||
ARG INTERNAL_VERSION
|
ARG INTERNAL_VERSION
|
||||||
|
17
entrypoint.sh
Normal file
17
entrypoint.sh
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
#
|
||||||
|
# ab-dart-sass entrypoint script
|
||||||
|
#
|
||||||
|
|
||||||
|
if [ "$1" = "shell" ]; then
|
||||||
|
exec /bin/bash
|
||||||
|
elif [ -n "$1" ]; then
|
||||||
|
exec "$@"
|
||||||
|
else
|
||||||
|
exec /opt/dart-sass/sass -s "$SASS_STYLE" --watch --poll --stop-on-error /sass:/css
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit $?
|
||||||
|
|
||||||
|
#EOF
|
Loading…
Reference in New Issue
Block a user