diff --git a/docker-compose.yml b/docker-compose.yml index cb936f5..3d898a7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,8 +2,6 @@ x-function: &common_setup build: context: . dockerfile: ./docker/Dockerfile - extra_hosts: - - 'host.docker.internal:host-gateway' restart: always depends_on: - mysql diff --git a/docker/Dockerfile b/docker/Dockerfile index d6dbd9a..3487dc5 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,59 +1,4 @@ -FROM alpine:latest - -WORKDIR /var/www/html - -# Essentials -RUN echo "UTC" > /etc/timezone && \ - apk add --no-cache zip unzip curl sqlite bash && \ - sed -i 's/bin\/ash/bin\/bash/g' /etc/passwd - -# Installing PHP and extensions -RUN apk add --no-cache php83 \ - php83-common \ - php83-gd \ - php83-pdo \ - php83-opcache \ - php83-zip \ - php83-phar \ - php83-iconv \ - php83-cli \ - php83-curl \ - php83-openssl \ - php83-mbstring \ - php83-tokenizer \ - php83-fileinfo \ - php83-json \ - php83-xml \ - php83-xmlwriter \ - php83-xmlreader \ - php83-simplexml \ - php83-dom \ - php83-pdo_mysql \ - php83-pdo_sqlite \ - php83-pecl-redis \ - php83-intl \ - php83-exif \ - php83-pcntl \ - php83-sockets \ - php83-posix \ - php83-dev \ - php83-pear \ - gcc \ - make \ - autoconf \ - musl-dev - -# Install excimer via pecl -RUN pecl install excimer && echo "extension=excimer.so" > /etc/php83/conf.d/50_excimer.ini - -# Remove build dependencies -RUN apk del gcc make autoconf musl-dev php83-dev - -# PHP Configuration -COPY ./docker/php/custom.ini /etc/php83/conf.d/custom.ini - -# Install Composer -COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer +FROM ghcr.io/fabioassuncao/php:8.3 # Download and set up FrankenPHP ADD https://github.com/dunglas/frankenphp/releases/latest/download/frankenphp-linux-x86_64 /usr/local/bin/frankenphp @@ -63,10 +8,3 @@ RUN chmod +x /usr/local/bin/frankenphp COPY . /var/www/html RUN composer install && \ chown -R nobody:nobody /var/www/html/storage - -COPY ./docker/entrypoint.sh /usr/local/bin/entrypoint -RUN chmod +x /usr/local/bin/entrypoint - -EXPOSE 8000 - -ENTRYPOINT ["/usr/local/bin/entrypoint"] diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh deleted file mode 100755 index a04a6b2..0000000 --- a/docker/entrypoint.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash - -set -e - -# Set default values if not provided -: ${CONTAINER_MODE:='manual'} -: ${CONTAINER_ROLE:='app'} -: ${APP_ENV:='production'} -ARTISAN="php -d variables_order=EGPCS /var/www/html/artisan" - -# Function to run setup tasks -run_setup_tasks() { - echo "Preparing application..." - chown -R nobody:nobody /var/www/html/storage - php artisan storage:link || true - php artisan config:cache || true - php artisan migrate --force || true -} - -# Check if vendor directory exists -while [ ! -d "/var/www/html/vendor" ]; do - echo "WARNING: The directory /var/www/html/vendor does not exist yet. Please run the \"composer install\" command to ensure that all necessary dependencies are properly installed." - echo "Retrying in 180 seconds..." - sleep 180s -done - -# Run setup tasks if in automatic mode -if [ "$CONTAINER_MODE" = "automatic" ]; then - run_setup_tasks -fi - -# Execute role-specific commands -case "$CONTAINER_ROLE" in - app) - echo "INFO: Running octane..." - exec $ARTISAN octane:start --host=0.0.0.0 --port=8000 - ;; - worker) - echo "INFO: Running the queue..." - exec $ARTISAN queue:work -vv --no-interaction --tries=3 --sleep=5 --timeout=300 --delay=10 - ;; - horizon) - echo "INFO: Running the horizon..." - exec $ARTISAN horizon - ;; - scheduler) - while true; do - echo "INFO: Running scheduled tasks." && exec $ARTISAN schedule:run --verbose --no-interaction & - sleep 60s - done - ;; - *) - echo "Could not match the container role \"$CONTAINER_ROLE\"" - exit 1 - ;; -esac diff --git a/docker/php/custom.ini b/docker/php/custom.ini deleted file mode 100644 index 96fbda6..0000000 --- a/docker/php/custom.ini +++ /dev/null @@ -1,4 +0,0 @@ -upload_max_filesize = 2500M -post_max_size = 2500M -max_execution_time = 9000 -max_input_time = 9000