From 2ad773952e47402cdc4fc37164b14ecf3dc7026f Mon Sep 17 00:00:00 2001 From: hackerESQ Date: Thu, 19 Dec 2024 21:53:50 -0600 Subject: [PATCH] chore: slim down docker build --- .dockerignore | 5 +++++ docker/Dockerfile | 56 +++++++++++++++++++++++------------------------ 2 files changed, 32 insertions(+), 29 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3b493d6 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +.git +node_modules +packages +vendor +tests \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile index 96b5667..dcd7733 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,42 +2,40 @@ FROM php:8.3-fpm ENV DEBIAN_FRONTEND=noninteractive -# Install common php extension dependencies -RUN apt-get update && apt-get install -y \ - libfreetype-dev \ - libjpeg62-turbo-dev \ - libpng-dev \ - zlib1g-dev \ - libzip-dev \ - unzip \ - libicu-dev \ - git \ - curl \ - supervisor \ - && docker-php-ext-configure gd --with-freetype --with-jpeg \ - && docker-php-ext-install -j$(nproc) \ - gd \ - zip \ - pdo_mysql \ - mysqli \ - intl - # Set the working directory COPY . /var/www/app WORKDIR /var/www/app -# Install Node.js and npm -RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ - && apt-get install -y nodejs \ - && npm install -g npm@latest - -# Copy over supervisor configuration -COPY ./docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf - # Set permissions RUN chown -R www-data:www-data . \ && chmod -R 775 ./storage \ - && chmod +x ./docker/entrypoint.sh + && chmod +x ./docker/entrypoint.sh \ +# Install common php extension dependencies + && apt-get update && apt-get install -y \ + libfreetype-dev \ + libjpeg62-turbo-dev \ + libpng-dev \ + zlib1g-dev \ + libzip-dev \ + unzip \ + libicu-dev \ + git \ + curl \ + supervisor \ + && docker-php-ext-configure gd --with-freetype --with-jpeg \ + && docker-php-ext-install -j$(nproc) \ + gd \ + zip \ + pdo_mysql \ + mysqli \ + intl \ +# Install Node.js and npm + && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ + && apt-get install -y nodejs \ + && npm install -g npm@latest + +# Copy over supervisor configuration +COPY ./docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf # Install composer COPY --from=composer:2.6.5 /usr/bin/composer /usr/local/bin/composer