Skip to content

Instantly share code, notes, and snippets.

@iconnor
Last active July 11, 2019 06:00
Show Gist options
  • Save iconnor/322ee5cbe37eebdf55434b96bab60b8f to your computer and use it in GitHub Desktop.
Save iconnor/322ee5cbe37eebdf55434b96bab60b8f to your computer and use it in GitHub Desktop.
PHP laravel with composer
#start with our base image (the foundation) - version 7.1.5
FROM businesstools/nginx-php:1.8.0
#install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer
#set our application folder as an environment variable
ENV APP_HOME /var/www/html
ENV COMPOSER_ALLOW_SUPERUSER=1
ENV COMPOSER_NO_INTERACTION=1
#copy source files and run composer
COPY . $APP_HOME
# From https://gist.github.com/iconnor/dec415fdb11d92cb41e4dcc8dd8c848d
COPY default.conf /etc/nginx/conf.d/default.conf
COPY php.ini /usr/local/etc/php/conf.d/
WORKDIR $APP_HOME
# install all PHP dependencies
RUN composer install --no-interaction
#change ownership of our applications
RUN chown -R www-data:www-data $APP_HOME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment