From c6b9df777368b93616585533232dce132a6f6948 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 8 Jul 2022 14:10:30 +0200 Subject: [PATCH] websockets --- Dockerfile | 1 + websockets-entrypoint.sh | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100755 websockets-entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 907f4ce..889c8ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,7 @@ ENV PHPVER=7.4 COPY --from=builder /var/www /var/www COPY entrypoint.sh /entrypoint.sh COPY worker-entrypoint.sh /worker-entrypoint.sh +COPY websockets-entrypoint.sh /websockets-entrypoint.sh COPY wait-for-db.php /wait-for-db.php RUN apt-install php${PHPVER}-curl php${PHPVER}-zip php${PHPVER}-bcmath php${PHPVER}-intl php${PHPVER}-mbstring php${PHPVER}-xml optipng pngquant jpegoptim gifsicle ffmpeg php${PHPVER}-imagick php${PHPVER}-gd php${PHPVER}-redis php${PHPVER}-mysql php${PHPVER}-pgsql &&\ a2enmod rewrite &&\ diff --git a/websockets-entrypoint.sh b/websockets-entrypoint.sh new file mode 100755 index 0000000..b6e3898 --- /dev/null +++ b/websockets-entrypoint.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +set -xeo pipefail + +php /wait-for-db.php + +if [[ ! -e storage/.docker.init ]]; +then + echo "Database is not initialized yet, exiting..." + sleep 5 + exit 1 +fi + +gosu www-data php artisan migrate:status | grep No && migrations=yes || migrations=no +if [ $migrations = "yes" ]; +then + echo "Database needs migrations, exiting..." + sleep 5 + exit 1 +fi + +gosu www-data php artisan websockets:serve