Skip to content

Commit

Permalink
Merge pull request simjanos-dev#91 from sergiolaverde0/test-build
Browse files Browse the repository at this point in the history
Slightly reduce image size
  • Loading branch information
simjanos-dev authored Jan 27, 2024
2 parents 19da44e + 55ea8e3 commit b155c45
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 0 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,3 @@ PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

COMPOSER_ALLOW_SUPERUSER=1
17 changes: 11 additions & 6 deletions docker/PhpDockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM php:8.2-apache

ENV COMPOSER_ALLOW_SUPERUSER=1

RUN curl -sL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh \
&& chmod +x ./nodesource_setup.sh \
&& ./nodesource_setup.sh \
Expand Down Expand Up @@ -38,23 +40,26 @@ RUN printf 'max_execution_time = 600\n' >> /usr/local/etc/php/conf.d/uploads.ini
# copy apache config
COPY ./docker/vhost.conf /etc/apache2/sites-available/000-default.conf

COPY ./ /var/www/html
COPY --chown=www-data:www-data ./ /var/www/html

# set project directory owner
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN chown -R www-data:www-data /var/www/html \
# enable htaccess
&& a2enmod rewrite \
RUN a2enmod rewrite
# install composer
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer

# for some reason i have to install this manually,
# despite being in the composer.json
# RUN composer require guzzlehttp/guzzle

RUN composer install \
RUN composer install --optimize-autoloader --no-dev\
&& npm install \
&& npm run prod
&& npm run prod \
&& rm -rf /usr/local/share/.cache \
/root/.npm \
/tmp/* \
/usr/local/bin/composer

ENTRYPOINT ["/var/www/html/entrypoint.sh"]
CMD ["apache2-foreground"]

0 comments on commit b155c45

Please sign in to comment.