Skip to content

Commit

Permalink
Merge pull request #27 from City-of-Helsinki/UHF-9884
Browse files Browse the repository at this point in the history
UHF-9884: Revert s6-overlay
  • Loading branch information
tuutti authored Apr 2, 2024
2 parents 511d1cd + 5284778 commit d4aa6a4
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 8 deletions.
15 changes: 7 additions & 8 deletions openshift/drupal-repository/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
FROM alpine:3.19
COPY --from=almir/webhook /usr/local/bin/webhook /usr/local/bin/webhook

ARG S6_OVERLAY_VERSION=3.1.6.2
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz

# We need php and git to build satis.
RUN apk add --no-cache git php82 php82-openssl php82-common php82-json php82-phar php82-mbstring php82-pecl-apcu php82-zip php82-simplexml make
RUN apk add --no-cache git php82 php82-openssl php82-common php82-json php82-phar php82-mbstring php82-pecl-apcu php82-zip php82-simplexml make tini

ENV COMPOSER_HOME=/.composer
ENV PROJECT_DIR=/var/www/html
Expand All @@ -24,4 +18,9 @@ EXPOSE 9000

# Copy configuration files and scripts
COPY files/ /
ENTRYPOINT ["/init"]
RUN chmod +x /entrypoints/* && \
chmod +x /usr/local/bin/entrypoint
ENTRYPOINT ["/sbin/tini", "--"]

# Default command: Start up multiple services via entrypoint
CMD ["entrypoint"]
9 changes: 9 additions & 0 deletions openshift/drupal-repository/files/entrypoints/10-queue.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
cd $PROJECT_DIR
make

(while true
do
php console.php queue:consume package-queue --item-limit 10
done) &

2 changes: 2 additions & 0 deletions openshift/drupal-repository/files/entrypoints/99-webhook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
/usr/local/bin/webhook -verbose -hooks=/etc/webhook/hooks.json -template -hotreload -debug
19 changes: 19 additions & 0 deletions openshift/drupal-repository/files/usr/local/bin/entrypoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

# This script will be the default ENTRYPOINT for all children docker images.
# It just sources all files within /entrypoints/* in an alphabetical order and then runs `exec` on the given parameter.

if [ -d /entrypoints ]; then
for i in /entrypoints/*; do
if [ -r $i ]; then
echo "# Source $i"
. $i
else
echo "! $i not sourced"
fi
done
unset i
fi

echo "Exec: $@"
exec "$@"

0 comments on commit d4aa6a4

Please sign in to comment.