You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.6 KiB

4 years ago
  1. FROM php:7.2-apache
  2. RUN apt-get update
  3. # 1. development packages
  4. RUN apt-get install -y \
  5. git \
  6. zip \
  7. vim \
  8. curl \
  9. sudo \
  10. unzip \
  11. libicu-dev \
  12. libbz2-dev \
  13. libpng-dev \
  14. libjpeg-dev \
  15. libmcrypt-dev \
  16. libreadline-dev \
  17. libfreetype6-dev \
  18. g++
  19. # 2. apache configs + document root
  20. ENV APACHE_DOCUMENT_ROOT=/var/www/html
  21. RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
  22. RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
  23. # 3. mod_rewrite for URL rewrite and mod_headers for .htaccess extra headers like Access-Control-Allow-Origin-
  24. RUN a2enmod rewrite headers
  25. # 4. start with base php config, then add extensions
  26. RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
  27. RUN docker-php-ext-install \
  28. bz2 \
  29. intl \
  30. iconv \
  31. bcmath \
  32. opcache \
  33. calendar \
  34. mbstring \
  35. pdo_mysql \
  36. zip
  37. # 5. composer
  38. # COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
  39. # 6. we need a user with the same UID/GID with host user
  40. # so when we execute CLI commands, all the host file's ownership remains intact
  41. # otherwise command from inside container will create root-owned files and directories
  42. #WORKDIR /var/www/html
  43. #ADD . /var/www/html
  44. COPY ./ /var/www/html
  45. RUN chown -R www-data:www-data /var/www/html
  46. #USER root
  47. #ARG uid
  48. #RUN useradd -G www-data,root -u $uid -d /home/soumya soumya
  49. #RUN mkdir -p /var/www/.composer && \
  50. # chown -R www-data:www-data /var/www
  51. #RUN chmod -R 777 /var/www
  52. #EXPOSE 8000