Advertisement
Guest User

Untitled

a guest
May 21st, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. FROM php:7.2-fpm
  2.  
  3. # Copy composer.lock and composer.json
  4. COPY composer.lock composer.json /var/www/
  5.  
  6. # Set working directory
  7. WORKDIR /var/www
  8.  
  9. # Install dependencies
  10. RUN apt-get update && apt-get install -y \
  11. build-essential \
  12. mysql-client \
  13. libpng-dev \
  14. libjpeg62-turbo-dev \
  15. libfreetype6-dev \
  16. locales \
  17. zip \
  18. jpegoptim optipng pngquant gifsicle \
  19. vim \
  20. unzip \
  21. git \
  22. curl \
  23. cron \
  24. supervisor
  25.  
  26. # Clear cache
  27. RUN apt-get clean && rm -rf /var/lib/apt/lists/*
  28.  
  29. # Install extensions
  30. RUN docker-php-ext-install pdo_mysql mbstring zip exif pcntl
  31. RUN docker-php-ext-configure gd --with-gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/
  32. RUN docker-php-ext-install gd
  33. RUN docker-php-ext-configure bcmath --enable-bcmath
  34. RUN docker-php-ext-install bcmath
  35. `
  36. # install mongodb ext
  37. RUN pecl install mongodb \
  38. && docker-php-ext-enable mongodb
  39.  
  40. # Install composer
  41. RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
  42.  
  43. # Add user for laravel application
  44. RUN groupadd -g 1000 www
  45. RUN useradd -u 1000 -ms /bin/bash -g www www
  46.  
  47. # Copy existing application directory contents
  48. COPY . /var/www
  49.  
  50. # Copy existing application directory permissions
  51. COPY --chown=www:www . /var/www
  52.  
  53. CMD ["/usr/bin/supervisord"]
  54.  
  55. # Change current user to www
  56. USER www
  57.  
  58. # Expose port 9000 and start php-fpm server
  59. EXPOSE 9000
  60. CMD ["php-fpm"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement