Skip to content

Instantly share code, notes, and snippets.

@mhemrg
Created April 16, 2019 12:40
Show Gist options
  • Save mhemrg/d4edcdb80b485c717b1d19bd9b68578b to your computer and use it in GitHub Desktop.
Save mhemrg/d4edcdb80b485c717b1d19bd9b68578b to your computer and use it in GitHub Desktop.
Liara - Laravel platform with no-scripts
FROM thecodingmachine/php:7.2-v2-apache-node8
ENV APACHE_DOCUMENT_ROOT=/public \
TEMPLATE_PHP_INI=production \
PHP_EXTENSIONS="amqp bcmath calendar exif gd gettext \
gmp gnupg igbinary imagick imap intl ldap mcrypt memcached \
mongodb pcntl pdo_dblib pdo_pgsql pgsql sockets yaml"
USER root
RUN composer global require hirak/prestissimo && \
composer global require bamarni/symfony-console-autocomplete && \
rm -rf $HOME\.composer
COPY . /var/www/html
RUN if [ -f /var/www/html/package-lock.json ]; then \
echo 'Running npm ci...' && npm ci && npm run prod; \
else \
echo 'Running npm install...' && npm install && npm run prod; \
fi
RUN mkdir -p bootstrap/cache \
&& sudo chgrp -R www-data storage bootstrap/cache \
&& sudo chmod -R ug+rwx storage bootstrap/cache \
&& composer install \
--no-dev \
--no-interaction \
--prefer-dist \
--optimize-autoloader \
--ansi \
--no-scripts
ENV APACHE_RUN_USER=www-data \
APACHE_RUN_GROUP=www-data \
COMPOSER_ALLOW_SUPERUSER=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment