Skip to content

Instantly share code, notes, and snippets.

@vaughany
Last active August 24, 2019 09:56
Show Gist options
  • Select an option

  • Save vaughany/5111cb265c618b421e66555dadb32436 to your computer and use it in GitHub Desktop.

Select an option

Save vaughany/5111cb265c618b421e66555dadb32436 to your computer and use it in GitHub Desktop.
Dockerfile to install Ubuntu, Apache2 and PHP7.2
# A basic apache server with PHP. To use either add or bind mount content under /var/www
# https://docs.docker.com/engine/reference/builder/
FROM ubuntu:16.04
# Use bash instead of sh.
SHELL ["/bin/bash", "-c"]
WORKDIR /app
ADD . /app
# Use the default UTF-8 language.
ENV LANG C.UTF-8
RUN apt-get update && apt-get -y install software-properties-common && add-apt-repository ppa:ondrej/php && apt-get update && apt-get install -y apache2 && apt-get install -y php7.2 && apt-get install -y libapache2-mod-php7.2 php7.2-curl php7.2-json && apt-get clean && rm -rf /var/lib/apt/lists/*
EXPOSE 80 443
RUN cp info.php /var/www/html/
ENTRYPOINT ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment