Skip to content

Commit

Permalink
Clean up Dockerfile.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bradez committed Mar 7, 2024
1 parent 28bd305 commit 7935733
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 32 deletions.
16 changes: 6 additions & 10 deletions configs/core/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
# Stage: setup-web-server
FROM php:apache-buster as setup-web-server

# Install dependencies.
# Install dependencies
RUN apt-get update -y && \
apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 && \
apt-get install -y libpq-dev libgmp-dev libsodium-dev libmemcached-dev zlib1g-dev wait-for-it libffi-dev golang-go && \
apt-get install -y inotify-tools libcurl4-openssl-dev libpq-dev libssl-dev supervisor dos2unix

# Install imagick
# Install imagick and redis
RUN apt-get install -y libmagickwand-dev --no-install-recommends && \
pecl install imagick
pecl install imagick redis

# Install node and npm
RUN curl -sL https://deb.nodesource.com/setup_16.x -o /tmp/nodesource_setup.sh
RUN bash /tmp/nodesource_setup.sh
RUN apt-get install -y nodejs

COPY scripts/ /usr/scripts/
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - &&\
apt-get install -y nodejs

# Install and enable additional php modules
RUN docker-php-ext-install ffi pdo pdo_mysql gmp bcmath sodium mysqli sockets pcntl gd

RUN /usr/scripts/install-php-redis.sh
RUN docker-php-ext-enable redis imagick

# Stage: create-application
Expand Down
16 changes: 6 additions & 10 deletions configs/core/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,23 @@ set -e

role=${CONTAINER_ROLE:-app}

echo "Caching configuration..."
php artisan cache:clear && php artisan config:cache

if [ "$role" = "ingest" ]; then
echo "Running ingest..."
php artisan cache:clear && php artisan config:cache && php artisan migrate && php artisan platform:sync && php artisan platform:ingest
php artisan migrate && php artisan platform:sync && php artisan platform:ingest
elif [ "$role" = "app" ]; then
echo "Caching configuration..."
APP_KEY=$(awk '$1 ~ /^APP_KEY/' .env | cut -d "=" -f 2)
if [ -z "$APP_KEY" ]; then
php artisan key:generate
fi
php artisan log-viewer:publish && php artisan platform-ui:install --route="/" --tenant="no" --skip && php artisan cache:clear && php artisan config:cache && php artisan route:cache && php artisan view:cache
php artisan log-viewer:publish && php artisan platform-ui:install --route="/" --tenant="no" --skip && php artisan route:cache && php artisan view:cache
echo "Running apache..."
exec apache2-foreground
elif [ "$role" = "websocket" ]; then
echo "Running queue and websocket..."
chown -hR www-data:www-data /var/www/html/storage/logs || true
php artisan cache:clear && php artisan config:cache
supervisord && supervisorctl start horizon
php artisan websockets:serve
elif [ "$role" = "beam" ]; then
echo "Running beam..."
php artisan cache:clear && php artisan config:cache && php artisan platform:process-beam-claims
php artisan platform:process-beam-claims
else
echo "Could not match the container role \"$role\""
exit 1
Expand Down
12 changes: 0 additions & 12 deletions scripts/install-php-redis.sh

This file was deleted.

0 comments on commit 7935733

Please sign in to comment.