Skip to content

Instantly share code, notes, and snippets.

@imammubin
Last active April 7, 2022 20:25
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 imammubin/0187ec20ddbfc719314da58a0e46340e to your computer and use it in GitHub Desktop.
Save imammubin/0187ec20ddbfc719314da58a0e46340e to your computer and use it in GitHub Desktop.
FROM ubuntu:18.04
# Identify the maintainer of an image
LABEL maintainer="imammubin.net@gmail.com"
# Update the image to the latest packages
RUN apt-get update && apt-get upgrade -y
## preesed tzdata, update package index, upgrade packages and install needed software
RUN echo "tzdata tzdata/Areas select Asia" > /tmp/preseed.txt; \
echo "tzdata tzdata/Zones/Asia select Jakarta" >> /tmp/preseed.txt; \
debconf-set-selections /tmp/preseed.txt && \
apt-get update && \
apt-get install -y tzdata
# Install PHP and other utility
RUN apt-get install build-essential software-properties-common apache2 sudo curl zip unzip git nano vim -y
RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php -y
RUN apt-get update && apt-get -y install phpunit php8.1 php8.1-xml php8.1-curl php8.1-mcrypt php8.1-mbstring
#RUN sed -i 's|DocumentRoot|ServerName localhost \n DocumentRoot|g' /etc/apache2/sites-available/000-default.conf
#RUN sed -i 's|/var/www/html|/var/www/html/laravel/public|g' /etc/apache2/sites-available/000-default.conf
RUN echo 'ServerName localhost' >> /etc/apache2/sites-available/000-default.conf
# Install composer
RUN curl -Ss https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer
WORKDIR /var/www/html
#RUN composer create-project laravel/laravel:^8
#CMD ["composer","create-project laravel/laravel:^8 laravel"]
#WORKDIR /var/www/html/laravel/
#RUN Apache
EXPOSE 80
CMD ["apachectl", "-D", "FOREGROUND"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment