Skip to content

Instantly share code, notes, and snippets.

@greenbicycle
Last active October 17, 2022 22:34
Show Gist options
  • Save greenbicycle/529474ea00667a9c08fb78bcdf5f063a to your computer and use it in GitHub Desktop.
Save greenbicycle/529474ea00667a9c08fb78bcdf5f063a to your computer and use it in GitHub Desktop.
Sample Ubuntu Dockerfile
#
# Ubuntu with Apache and PHP7.4
#
#FROM ubuntu:latest
FROM ubuntu/apache2
RUN apt-get update && apt-get upgrade -y
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=America/Phoenix
# RUN apt-get install -y tzdata#
RUN apt-get install ca-certificates apt-transport-https software-properties-common -y
RUN apt-add-repository ppa:ondrej/php -y
RUN apt-get update && apt-get install \
php7.4 \
git \
wget \
unzip \
rsync \
curl \
keychain \
libapache2-mod-php \
php7.4-curl \
php7.4-intl \
php7.4-mbstring \
php7.4-zip \
php7.4-gd \
php7.4-bcmath \
php7.4-ldap \
php7.4-mysql \
php7.4-mysqlnd \
php7.4-xml -y && apt-get clean
VOLUME /usr/local/sbin
VOLUME /etc/apache2/sites-available/
VOLUME /etc/apache2/ssl
VOLUME /var/www/vhosts
RUN a2enmod headers && a2enmod ssl && a2enmod rewrite && a2dismod php8.1 && a2enmod php7.4
RUN update-alternatives --set php /usr/bin/php7.4
EXPOSE 80
EXPOSE 443
CMD /usr/sbin/apache2ctl -D FOREGROUND
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment