Created
June 22, 2021 00:23
-
-
Save jjuanrivvera99/da8d7204bcc78aea12fa55757c7ccd57 to your computer and use it in GitHub Desktop.
dockerfile-laravel-php-7.2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:18.04 | |
ENV DEBIAN_FRONTEND=noninteractive | |
RUN apt-get update -yqq && apt-get install -yq --no-install-recommends \ | |
apt-utils \ | |
curl \ | |
# Install git | |
git \ | |
# Install apache | |
apache2 \ | |
# Install php 7.2 | |
php7.2 \ | |
libapache2-mod-php7.2 \ | |
php7.2-cli \ | |
php7.2-json \ | |
php7.2-curl \ | |
php7.2-fpm \ | |
php7.2-dev \ | |
php7.2-gd \ | |
php7.2-ldap \ | |
php7.2-mbstring \ | |
php7.2-bcmath \ | |
php7.2-mysql \ | |
php7.2-soap \ | |
php7.2-sqlite3 \ | |
php7.2-xml \ | |
php7.2-zip \ | |
php7.2-intl \ | |
libaio1 \ | |
libaio-dev \ | |
# Install tools | |
openssl \ | |
nano \ | |
ghostscript \ | |
iputils-ping \ | |
locales \ | |
rlwrap \ | |
php-pear \ | |
make \ | |
unzip \ | |
zip \ | |
tar \ | |
ca-certificates \ | |
&& apt-get clean | |
# Install composer | |
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | |
# Set locales | |
RUN locale-gen en_US.UTF-8 en_GB.UTF-8 de_DE.UTF-8 es_ES.UTF-8 fr_FR.UTF-8 it_IT.UTF-8 km_KH sv_SE.UTF-8 fi_FI.UTF-8 | |
# Configure PHP for My Site | |
COPY my-site.ini /etc/php/7.2/mods-available/ | |
RUN phpenmod my-site | |
# Configure apache for My Site | |
RUN a2enmod rewrite expires | |
RUN echo "ServerName localhost" | tee /etc/apache2/conf-available/servername.conf | |
RUN a2enconf servername | |
# Configure vhost for My Site | |
COPY my-site.conf /etc/apache2/sites-available/ | |
RUN a2dissite 000-default | |
RUN a2ensite my-site.conf | |
EXPOSE 80 443 | |
WORKDIR /var/www | |
CMD apachectl -D FOREGROUND |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment