Skip to content

Instantly share code, notes, and snippets.

@musaid
Created April 8, 2018 04:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save musaid/b1ffaccd5fea20c2f149b3a8c55cd429 to your computer and use it in GitHub Desktop.
Save musaid/b1ffaccd5fea20c2f149b3a8c55cd429 to your computer and use it in GitHub Desktop.
Dockerfile musaid/apache:2.0.0
FROM ubuntu:16.04
# Set the env variable DEBIAN_FRONTEND to noninteractive
ARG DEBIAN_FRONTEND=noninteractive
ARG LC_ALL=C.UTF-8
# Set the locale
RUN apt-get clean && apt-get update && apt-get install -y locales
# Set the locale
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Set up apache
RUN apt-get update \
&& apt-get -y install apache2
RUN a2enmod headers rewrite
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_PID_FILE /var/run/apache2.pid
ENV APACHE_RUN_DIR /var/run/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2
RUN ln -sf /dev/stdout /var/log/apache2/access.log && \
ln -sf /dev/stderr /var/log/apache2/error.log
RUN mkdir -p $APACHE_RUN_DIR $APACHE_LOCK_DIR $APACHE_LOG_DIR
VOLUME [ "/var/www/html" ]
WORKDIR /var/www/html
EXPOSE 80
ENTRYPOINT [ "/usr/sbin/apache2" ]
CMD ["-D", "FOREGROUND"]
# Install python software properties
RUN apt-get install -y software-properties-common python-software-properties curl
# Install essential packages
RUN set -e; \
add-apt-repository -y ppa:ondrej/php && \
curl https://packagecloud.io/gpg.key | apt-key add - && \
echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list && \
apt-get update && apt-get install -y --no-install-recommends \
curl \
git \
locales \
ca-certificates \
curl \
zip \
memcached \
php-pear \
# install PHP
php-memcache \
php-memcached \
php-redis \
php7.2 \
php7.2-common php7.2-json php7.2-opcache php7.2-readline \
php7.2-cli \
php7.2-curl \
php7.2-gd \
php7.2-json \
php7.2-mbstring \
php7.2-oauth \
php7.2-opcache \
php7.2-soap \
php7.2-xml \
php7.2-zip \
php7.2-yaml \
blackfire-agent blackfire-php
# xdebug log dir
RUN test ! -e /var/log/xdebug && mkdir /var/log/xdebug && chown root:www-data /var/log/xdebug
RUN curl -sS https://getcomposer.org/installer | php -- --filename=composer --install-dir=/usr/local/bin
# Set up CA root certificates
RUN mkdir -p /etc/ssl/certs/ && update-ca-certificates --fresh
# Clean
RUN apt-get purge -y --auto-remove && apt-get clean all && rm -rf /var/lib/apt/ && /etc/init.d/memcached start && php -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment