diff --git a/Dockerfile b/Dockerfile index be7fba93a..0f75ebac4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,7 +36,6 @@ COPY . . RUN mkdir -p /etc/my_init.d /etc/systlog-ng /usr/local/bin /etc/monit static/fonts static/ldn /usr/local/nginx/logs/ \ && cp $QUAYCONF/init/*.sh /etc/my_init.d/ \ && cp $QUAYCONF/init/syslog-ng.conf /etc/syslog-ng/ \ - && cp -r $QUAYCONF/init/service/* /etc/service \ && cp $QUAYCONF/kill-buildmanager.sh /usr/local/bin/kill-buildmanager.sh \ && cp $QUAYCONF/monitrc /etc/monit/monitrc \ && chmod 0600 /etc/monit/monitrc \ @@ -53,3 +52,5 @@ RUN ln -s $QUAYCONF /conf # && rm -rf /root/.npm /.npm /usr/local/lib/node_modules /usr/share/yarn/node_modules \ # /root/node_modules /node_modules /grunt RUN PYTHONPATH=$QUAYPATH venv/bin/alembic heads | grep -E '^[0-9a-f]+ \(head\)$' > ALEMBIC_HEAD + +CMD ./quay-entrypoint.sh \ No newline at end of file diff --git a/quay-entrypoint.sh b/quay-entrypoint.sh new file mode 100755 index 000000000..1e71169d5 --- /dev/null +++ b/quay-entrypoint.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +MODE="$1" + +display_usage() { + echo "This script takes one arguments." + echo -e "\nUsage: ${0} \n" +} + +if [[ "${MODE}" = "help" ]] +then + display_usage + exit 0 +fi + + +case "$MODE" in + "interactive") + echo "Copying $MODE files" + cp -r ${QUAYCONF}/init/service/interactive/* /etc/service + ;; + "batch") + echo "Copying $MODE files" + cp -r ${QUAYCONF}/init/service/batch/* /etc/service + ;; + *) + echo "Copying all files" + cp -r ${QUAYCONF}/init/service/interactive/* /etc/service + cp -r ${QUAYCONF}/init/service/batch/* /etc/service + ;; +esac + +/sbin/my_init \ No newline at end of file