diff --git a/Dockerfile b/Dockerfile index a6bc05813438bab2b2b92554385905fdf5122c11..aa8ca2b0102691d1d669ca79b122b3ff17b5ac6f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,11 +48,11 @@ ARG MMCIF_USER_ID=501 RUN adduser --system -u ${MMCIF_USER_ID} mmcif -#COPY --chmod=755 docker-entrypoint.sh / +COPY --chmod=755 docker-entrypoint.sh / USER mmcif -#ENTRYPOINT ["/docker-entrypoint.sh"] +ENTRYPOINT ["/docker-entrypoint.sh"] # LocalWords: ARG OST ARGs ENV SRC tmp PYTHONUNBUFFERED Schwede schwedelab py # LocalWords: PYTHONDONTWRITEBYTECODE Bioinformatics sib swiss Biozentrum ihm diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100644 index 0000000000000000000000000000000000000000..0540cda3a1f8f6624037ad72054ea6ec285d9df6 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,34 @@ +#!/bin/bash +## (We use sh since Alpine does not have Bash by default) + + +## exit immediately on commands with a non-zero exit status. +set -euo pipefail + +## When started without any arguments, "-h", "--help", "-help" or "help", print +## usage. +if [ $# -eq 0 ] || [ x$1 == x"-h" ] || [ x$1 == x"--help" ] || + [ x$1 == x"-help" ] || [ x$1 == x"help" ]; then + echo " ModelCIF file formating tool." + echo "------------------------------------------" + echo "Provided by SWISS-MODEL / Schwede group" + echo "(swissmodel.expasy.org / schwedelab.org)" + echo "" + echo "This container takes a directory of " + echo "AlphaFold2 models and turns them into " + echo "ModelCIF files." + echo "" + /usr/local/bin/translate2modelcif --help + exit 1 +fi +if [ x$1 == x"translate2modelcif" ] || [ x$1 == x"2cif" ]; then + echo "Let's go to the CIF site of life!" + shift + # take over the process, make translate2modelcif run on PID 1 + exec /usr/local/bin/translate2modelcif $@ + exit $? +fi + +exec "$@" + +# LocalWords: euo pipefail eq Schwede schwedelab mmcif fi