Skip to content

Commit

Permalink
Merge pull request #449 from jesusantguerrero/feat/coolify
Browse files Browse the repository at this point in the history
chore: update coolify docker images
  • Loading branch information
jesusantguerrero authored Sep 11, 2024
2 parents 33803f2 + 5004c23 commit 9e982cb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 39 deletions.
47 changes: 16 additions & 31 deletions coolify.Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
8 changes: 0 additions & 8 deletions docker-compose.coolify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9e982cb

Please sign in to comment.