Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save xenonstack1/e9d4387d2809738f026671ade9eeaaa2 to your computer and use it in GitHub Desktop.
Save xenonstack1/e9d4387d2809738f026671ade9eeaaa2 to your computer and use it in GitHub Desktop.
FROM ubuntu:14.04
MAINTAINER Xenonstack
# Installing PHP5 and Apache2
RUN apt-get update \
&& apt-get -y install apache2 php5 libapache2-mod-php5 php5-mcrypt php5-json curl git \
&& apt-get clean \
&& update-rc.d apache2 defaults \
&& php5enmod mcrypt \
&& rm -rf /var/www/html \
&& rm -r /var/lib/apt/lists/*
# Installing Composer
RUN curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/composer
# Adding Laravel configurations for apache2
COPY laravel.conf /etc/apache2/sites-available/000-default.conf
# Setting Working Directory
WORKDIR /var/www
# Creating PHP laravel project
RUN composer create-project --prefer-dist laravel/laravel laravel \
&& php laravel/artisan key:generate \
&& chown www-data:www-data -R laravel/storage
# Expose Apache2 Port
EXPOSE 80
# Persistent Data
VOLUME ["/var/www"]
# Starting Apache2 Web Server
CMD /usr/sbin/apache2ctl -D FOREGROUND
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment