Advertisement
Guest User

Untitled

a guest
May 21st, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 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 supervisor configs
  48. COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
  49.  
  50. # Copy existing application directory contents
  51. COPY . /var/www
  52.  
  53. # Copy existing application directory permissions
  54. COPY --chown=www:www . /var/www
  55.  
  56. CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
  57. CMD ["/usr/bin/supervisorctl", "-c", "/etc/supervisor/supervisord.conf"]
  58. CMD ["/usr/bin/supervisord"]
  59. CMD ["/usr/bin/supervisorctl", "start ohwo-worker"]
  60.  
  61. # Change current user to www
  62. USER www
  63.  
  64. # Expose port 9000 and start php-fpm server
  65. EXPOSE 9000
  66. CMD ["php-fpm"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement