diff --git a/coolify.Dockerfile b/coolify.Dockerfile index b5e0857e..0b35dc35 100644 --- a/coolify.Dockerfile +++ b/coolify.Dockerfile @@ -1,36 +1,12 @@ -FROM dunglas/frankenphp as builder - ARG NODE_VERSION=20.9.0 -# Install system dependencies -RUN apt-get update && apt-get install -y \ - git \ - curl \ - libpng-dev \ - libonig-dev \ - libxml2-dev \ - zip \ - unzip \ - cron \ - default-mysql-client -# Clear cache -RUN apt-get clean && rm -rf /var/lib/apt/lists/* && \ -# Install PHP extensions -docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd && \ -#install mailparse -pecl install mailparse && \ -echo extension=mailparse.so > /usr/local/etc/php/conf.d/mailparse.ini && \ -echo "max_execution_time=900" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini -# Get latest Composer -COPY --from=composer:latest /usr/bin/composer /usr/bin/composer - -RUN composer install --no-dev --no-interaction --no-plugins --no-scripts --prefer-dist - FROM node:${NODE_VERSION}-alpine as static-assets + +RUN apk add --no-cache gcompat WORKDIR /app -COPY . . -COPY --from=builder --chown=9999:9999 /app /app -RUN npm install -RUN npm run build + +COPY . /app + +RUN yarn install --frozen-lockfile && yarn && yarn build && npm prune --production FROM dunglas/frankenphp as server @@ -63,4 +39,13 @@ echo "max_execution_time=900" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug # Get latest Composer COPY --from=composer:latest /usr/bin/composer /usr/bin/composer -COPY --from=builder --chown=user:group /app /app +RUN composer install --no-dev --no-interaction --no-plugins --no-scripts --prefer-dist + +COPY --from=static-assets --chown=9999:9999 /app/public/build ./public/build + +RUN php artisan route:cache +RUN php artisan view:cache + +RUN echo "alias ll='ls -al'" >>/etc/bash.bashrc +RUN echo "alias a='php artisan'" >>/etc/bash.bashrc +RUN echo "alias logs='tail -f storage/logs/laravel.log'" >>/etc/bash.bashrc diff --git a/docker-compose.coolify.yml b/docker-compose.coolify.yml index aaa4f49e..d649af1e 100644 --- a/docker-compose.coolify.yml +++ b/docker-compose.coolify.yml @@ -25,14 +25,6 @@ services: MERCURE_EXTRA_DIRECTIVES: |- cors_origins "*" anonymous - redis: - image: 'redis:alpine' - ports: - - '${FORWARD_REDIS_PORT:-6379}:6379' - volumes: - - ./docker-compose/redis:/data - networks: - - loger networks: loger: driver: bridge