Advertisement
Guest User

Untitled

a guest
Apr 6th, 2025
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.31 KB | None | 0 0
  1. FROM php:8.3-fpm-alpine3.20
  2.  
  3. RUN apk update && apk upgrade
  4.  
  5. # Essentials
  6. RUN echo "Europe/London" > /etc/timezone
  7. RUN apk add git zip unzip curl sqlite supervisor
  8.  
  9. # Install Python
  10. RUN apk add python3 py3-pip
  11.  
  12. RUN apk add nodejs npm
  13. RUN apk add nano
  14.  
  15. RUN apk add php83-gd \
  16. php83-imap \
  17. php83-redis \
  18. php83-cgi \
  19. php83-bcmath \
  20. php83-mysqli \
  21. php83-zlib \
  22. php83-curl \
  23. php83-zip \
  24. php83-mbstring \
  25. php83-iconv \
  26. gmp-dev
  27.  
  28. # dependencies required for running "phpize"
  29. # these get automatically installed and removed by "docker-php-ext-*" (unless they're already installed)
  30. ENV PHPIZE_DEPS \
  31. autoconf \
  32. dpkg-dev \
  33. dpkg \
  34. file \
  35. g++ \
  36. gcc \
  37. libc-dev \
  38. make \
  39. pkgconf \
  40. re2c \
  41. zlib \
  42. wget
  43.  
  44. # Install packages
  45. RUN set -eux; \
  46. # Packages needed only for build
  47. apk add --virtual .build-deps \
  48. $PHPIZE_DEPS
  49.  
  50. RUN apk add --no-cache linux-headers
  51.  
  52. # Packages to install
  53. RUN apk add curl \
  54. gettext-dev \
  55. libmcrypt-dev \
  56. icu-dev \
  57. libpng \
  58. libpng-dev \
  59. libressl-dev \
  60. libtool \
  61. libxml2-dev \
  62. libzip-dev \
  63. libjpeg-turbo-dev \
  64. libwebp-dev \
  65. freetype-dev \
  66. oniguruma-dev \
  67. unzip
  68.  
  69. # pecl PHP extensions
  70. RUN pecl install \
  71. # imagick-3.4.4 \
  72. mongodb \
  73. redis
  74. # Configure PHP extensions
  75. RUN docker-php-ext-configure \
  76. # ref: https://github.com/docker-library/php/issues/920#issuecomment-562864296
  77. gd --enable-gd --with-freetype --with-jpeg --with-webp
  78. # Install PHP extensions
  79. RUN docker-php-ext-install \
  80. bcmath \
  81. bz2 \
  82. exif \
  83. ftp \
  84. gettext \
  85. gd \
  86. # iconv \
  87. intl \
  88. gmp \
  89. mbstring \
  90. opcache \
  91. pdo \
  92. pdo_mysql \
  93. shmop \
  94. sockets \
  95. sysvmsg \
  96. sysvsem \
  97. sysvshm \
  98. zip \
  99. && \
  100. # Enable PHP extensions
  101. docker-php-ext-enable \
  102. # imagick \
  103. mongodb \
  104. redis \
  105. && \
  106. # Remove the build deps
  107. apk del .build-deps
  108. RUN apk cache clean
  109. # fix work iconv library with alphine for PHP 8.1 broken
  110. ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so
  111. # # Installing bash
  112. # RUN apk add bash
  113. # RUN sed -i 's/bin\/ash/bin\/bash/g' /etc/passwd
  114.  
  115. # Installing composer
  116. RUN curl -sS https://getcomposer.org/installer -o composer-setup.php
  117. RUN php composer-setup.php --install-dir=/usr/local/bin --filename=composer
  118. RUN rm -rf composer-setup.php
  119.  
  120. # Configure supervisor
  121. RUN mkdir -p /etc/supervisord/conf.d/
  122. RUN touch /run/supervisord.sock
  123. COPY ./docker-ops/backend/supervisord/laravel-worker.conf /etc/supervisord/conf.d/laravel-worker.conf
  124. COPY ./docker-ops/backend/supervisord/supervisord.ini /etc/supervisord/supervisord.ini
  125.  
  126. # Cron Config
  127. COPY ./docker-ops/backend/crontab /etc/crontabs/root
  128.  
  129. # Config PHP
  130. COPY ./docker-ops/backend/php/local.ini /usr/local/etc/php/php.ini
  131. # COPY ./ /var/www
  132. COPY --chown=www-data:www-data ./my-app /var/www
  133. COPY ./docker-ops/backend/scripts.env /var/www/resources/scripts/.env
  134. COPY ./docker-ops/backend/.env.laravel /var/www/.env
  135.  
  136.  
  137. # Install Python packages
  138. ENV PIP_BREAK_SYSTEM_PACKAGES 1
  139. RUN pip install -r /var/www/resources/scripts/requirements.txt
  140.  
  141.  
  142. USER root
  143. WORKDIR /var/www
  144.  
  145. EXPOSE 8000
  146.  
  147. CMD ["php", "artisan", "serve", "--host", "0.0.0.0", "--port=8000"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement