Dockerfile 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142
  1. #
  2. #--------------------------------------------------------------------------
  3. # Image Setup
  4. #--------------------------------------------------------------------------
  5. #
  6. # To edit the 'php-fpm' base Image, visit its repository on Github
  7. # https://github.com/Laradock/php-fpm
  8. #
  9. # To change its version, see the available Tags on the Docker Hub:
  10. # https://hub.docker.com/r/laradock/php-fpm/tags/
  11. #
  12. # Note: Base Image name format {image-tag}-{php-version}
  13. #
  14. ARG LARADOCK_PHP_VERSION
  15. ARG BASE_IMAGE_TAG_PREFIX=latest
  16. FROM laradock/php-fpm:${BASE_IMAGE_TAG_PREFIX}-${LARADOCK_PHP_VERSION}
  17. LABEL maintainer="Mahmoud Zalt <mahmoud@zalt.me>"
  18. ARG LARADOCK_PHP_VERSION
  19. # Set Environment Variables
  20. ENV DEBIAN_FRONTEND noninteractive
  21. # If you're in China, or you need to change sources, will be set CHANGE_SOURCE to true in .env.
  22. ARG CHANGE_SOURCE=false
  23. RUN if [ ${CHANGE_SOURCE} = true ]; then \
  24. # Change application source from deb.debian.org to aliyun source
  25. sed -i 's/deb.debian.org/mirrors.aliyun.com/' /etc/apt/sources.list && \
  26. sed -i 's/security.debian.org/mirrors.aliyun.com/' /etc/apt/sources.list && \
  27. sed -i 's/security-cdn.debian.org/mirrors.aliyun.com/' /etc/apt/sources.list \
  28. ;fi
  29. # always run apt update when start and after add new source list, then clean up at end.
  30. RUN set -xe; \
  31. apt-get update -yqq && \
  32. pecl channel-update pecl.php.net && \
  33. apt-get install -yqq \
  34. apt-utils \
  35. #
  36. #--------------------------------------------------------------------------
  37. # Mandatory Software's Installation
  38. #--------------------------------------------------------------------------
  39. #
  40. # Mandatory Software's such as ("mcrypt", "pdo_mysql", "libssl-dev", ....)
  41. # are installed on the base image 'laradock/php-fpm' image. If you want
  42. # to add more Software's or remove existing one, you need to edit the
  43. # base image (https://github.com/Laradock/php-fpm).
  44. #
  45. # next lines are here becase there is no auto build on dockerhub see https://github.com/laradock/laradock/pull/1903#issuecomment-463142846
  46. libzip-dev zip unzip && \
  47. if [ ${LARADOCK_PHP_VERSION} = "7.3" ] || [ ${LARADOCK_PHP_VERSION} = "7.4" ] || [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
  48. docker-php-ext-configure zip; \
  49. else \
  50. docker-php-ext-configure zip --with-libzip; \
  51. fi && \
  52. # Install the zip extension
  53. docker-php-ext-install zip && \
  54. php -m | grep -q 'zip'
  55. #
  56. #--------------------------------------------------------------------------
  57. # Optional Software's Installation
  58. #--------------------------------------------------------------------------
  59. #
  60. # Optional Software's will only be installed if you set them to `true`
  61. # in the `docker-compose.yml` before the build.
  62. # Example:
  63. # - INSTALL_SOAP=true
  64. #
  65. ###########################################################################
  66. # BZ2:
  67. ###########################################################################
  68. ARG INSTALL_BZ2=false
  69. RUN if [ ${INSTALL_BZ2} = true ]; then \
  70. apt-get -y install libbz2-dev; \
  71. docker-php-ext-install bz2 \
  72. ;fi
  73. ###########################################################################
  74. # GMP (GNU Multiple Precision):
  75. ###########################################################################
  76. ARG INSTALL_GMP=false
  77. RUN if [ ${INSTALL_GMP} = true ]; then \
  78. # Install the GMP extension
  79. apt-get install -y libgmp-dev && \
  80. if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
  81. ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h \
  82. ;fi && \
  83. docker-php-ext-install gmp \
  84. ;fi
  85. ###########################################################################
  86. # GnuPG:
  87. ###########################################################################
  88. ARG INSTALL_GNUPG=false
  89. RUN if [ ${INSTALL_GNUPG} = true ]; then \
  90. apt-get -yq install libgpgme-dev; \
  91. if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
  92. pecl install gnupg-1.5.0RC2; \
  93. else \
  94. pecl install gnupg; \
  95. fi; \
  96. fi
  97. ###########################################################################
  98. # SSH2:
  99. ###########################################################################
  100. ARG INSTALL_SSH2=false
  101. RUN if [ ${INSTALL_SSH2} = true ]; then \
  102. # Install the ssh2 extension
  103. apt-get -y install libssh2-1-dev && \
  104. if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
  105. pecl install -a ssh2-0.13; \
  106. else \
  107. pecl install -a ssh2-1.3.1; \
  108. fi && \
  109. docker-php-ext-enable ssh2 \
  110. ;fi
  111. ###########################################################################
  112. # libfaketime:
  113. ###########################################################################
  114. USER root
  115. ARG INSTALL_FAKETIME=false
  116. RUN if [ ${INSTALL_FAKETIME} = true ]; then \
  117. apt-get install -y libfaketime \
  118. ;fi
  119. ###########################################################################
  120. # SOAP:
  121. ###########################################################################
  122. ARG INSTALL_SOAP=false
  123. RUN if [ ${INSTALL_SOAP} = true ]; then \
  124. # Install the soap extension
  125. rm /etc/apt/preferences.d/no-debian-php && \
  126. apt-get -y install libxml2-dev php-soap && \
  127. docker-php-ext-install soap \
  128. ;fi
  129. ###########################################################################
  130. # XSL:
  131. ###########################################################################
  132. ARG INSTALL_XSL=false
  133. RUN if [ ${INSTALL_XSL} = true ]; then \
  134. # Install the xsl extension
  135. apt-get -y install libxslt-dev && \
  136. docker-php-ext-install xsl \
  137. ;fi
  138. ###########################################################################
  139. # pgsql
  140. ###########################################################################
  141. ARG INSTALL_PGSQL=false
  142. RUN if [ ${INSTALL_PGSQL} = true ]; then \
  143. # Install the pgsql extension
  144. docker-php-ext-install pgsql \
  145. ;fi
  146. ###########################################################################
  147. # pgsql client
  148. ###########################################################################
  149. ARG INSTALL_PG_CLIENT=false
  150. ARG INSTALL_POSTGIS=false
  151. RUN if [ ${INSTALL_PG_CLIENT} = true ]; then \
  152. # Create folders if not exists (https://github.com/tianon/docker-brew-debian/issues/65)
  153. mkdir -p /usr/share/man/man1 && \
  154. mkdir -p /usr/share/man/man7 && \
  155. # Install the pgsql client
  156. apt-get install -y postgresql-client && \
  157. if [ ${INSTALL_POSTGIS} = true ]; then \
  158. apt-get install -y postgis; \
  159. fi \
  160. ;fi
  161. ###########################################################################
  162. # xDebug:
  163. ###########################################################################
  164. ARG INSTALL_XDEBUG=false
  165. RUN if [ ${INSTALL_XDEBUG} = true ]; then \
  166. # Install the xdebug extension
  167. if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
  168. pecl install xdebug-3.0.0; \
  169. else \
  170. if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
  171. pecl install xdebug-2.5.5; \
  172. else \
  173. if [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ]; then \
  174. pecl install xdebug-2.9.0; \
  175. else \
  176. pecl install xdebug-2.9.8; \
  177. fi \
  178. fi \
  179. fi && \
  180. docker-php-ext-enable xdebug \
  181. ;fi
  182. # Copy xdebug configuration for remote debugging
  183. COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
  184. RUN if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
  185. sed -i "s/xdebug.remote_host=/xdebug.client_host=/" /usr/local/etc/php/conf.d/xdebug.ini && \
  186. sed -i "s/xdebug.remote_connect_back=0/xdebug.discover_client_host=false/" /usr/local/etc/php/conf.d/xdebug.ini && \
  187. sed -i "s/xdebug.remote_port=9000/xdebug.client_port=9003/" /usr/local/etc/php/conf.d/xdebug.ini && \
  188. sed -i "s/xdebug.profiler_enable=0/; xdebug.profiler_enable=0/" /usr/local/etc/php/conf.d/xdebug.ini && \
  189. sed -i "s/xdebug.profiler_output_dir=/xdebug.output_dir=/" /usr/local/etc/php/conf.d/xdebug.ini && \
  190. sed -i "s/xdebug.remote_mode=req/; xdebug.remote_mode=req/" /usr/local/etc/php/conf.d/xdebug.ini && \
  191. sed -i "s/xdebug.remote_autostart=0/xdebug.start_with_request=yes/" /usr/local/etc/php/conf.d/xdebug.ini && \
  192. sed -i "s/xdebug.remote_enable=0/xdebug.mode=debug/" /usr/local/etc/php/conf.d/xdebug.ini \
  193. ;else \
  194. sed -i "s/xdebug.remote_autostart=0/xdebug.remote_autostart=1/" /usr/local/etc/php/conf.d/xdebug.ini && \
  195. sed -i "s/xdebug.remote_enable=0/xdebug.remote_enable=1/" /usr/local/etc/php/conf.d/xdebug.ini \
  196. ;fi
  197. RUN sed -i "s/xdebug.cli_color=0/xdebug.cli_color=1/" /usr/local/etc/php/conf.d/xdebug.ini
  198. ###########################################################################
  199. # pcov:
  200. ###########################################################################
  201. USER root
  202. ARG INSTALL_PCOV=false
  203. RUN if [ ${INSTALL_PCOV} = true ]; then \
  204. if [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ]; then \
  205. if [ $(php -r "echo PHP_MINOR_VERSION;") != "0" ]; then \
  206. pecl install pcov && \
  207. docker-php-ext-enable pcov \
  208. ;fi \
  209. ;fi \
  210. ;fi
  211. ###########################################################################
  212. # Phpdbg:
  213. ###########################################################################
  214. ARG INSTALL_PHPDBG=false
  215. RUN if [ ${INSTALL_PHPDBG} = true ]; then \
  216. # Load the xdebug extension only with phpunit commands
  217. apt-get install -y --force-yes php${LARADOCK_PHP_VERSION}-phpdbg \
  218. ;fi
  219. ###########################################################################
  220. # Blackfire:
  221. ###########################################################################
  222. ARG INSTALL_BLACKFIRE=false
  223. RUN if [ ${INSTALL_XDEBUG} = false -a ${INSTALL_BLACKFIRE} = true ]; then \
  224. version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
  225. && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$version \
  226. && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp \
  227. && mv /tmp/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so \
  228. && printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707\n" > $PHP_INI_DIR/conf.d/blackfire.ini \
  229. ;fi
  230. ###########################################################################
  231. # PHP REDIS EXTENSION
  232. ###########################################################################
  233. ARG INSTALL_PHPREDIS=false
  234. RUN if [ ${INSTALL_PHPREDIS} = true ]; then \
  235. # Install Php Redis Extension
  236. if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
  237. pecl install -o -f redis-4.3.0; \
  238. else \
  239. pecl install -o -f redis; \
  240. fi \
  241. && rm -rf /tmp/pear \
  242. && docker-php-ext-enable redis \
  243. ;fi
  244. ###########################################################################
  245. # Swoole EXTENSION
  246. ###########################################################################
  247. ARG INSTALL_SWOOLE=false
  248. RUN set -eux; \
  249. if [ ${INSTALL_SWOOLE} = true ]; then \
  250. # Install Php Swoole Extension
  251. if [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "50600" ]; then \
  252. pecl install swoole-2.0.10; \
  253. elif [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70000" ]; then \
  254. pecl install swoole-4.3.5; \
  255. elif [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "70100" ]; then \
  256. pecl install swoole-4.5.11; \
  257. else \
  258. pecl install swoole; \
  259. fi; \
  260. docker-php-ext-enable swoole; \
  261. php -m | grep -q 'swoole'; \
  262. fi
  263. ###########################################################################
  264. # Taint EXTENSION
  265. ###########################################################################
  266. ARG INSTALL_TAINT=false
  267. RUN if [ ${INSTALL_TAINT} = true ]; then \
  268. # Install Php TAINT Extension
  269. if [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ]; then \
  270. pecl install taint && \
  271. docker-php-ext-enable taint && \
  272. php -m | grep -q 'taint'; \
  273. fi \
  274. ;fi
  275. ###########################################################################
  276. # MongoDB:
  277. ###########################################################################
  278. ARG INSTALL_MONGO=false
  279. RUN if [ ${INSTALL_MONGO} = true ]; then \
  280. # Install the mongodb extension
  281. if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
  282. pecl install mongo && \
  283. docker-php-ext-enable mongo \
  284. ;else \
  285. pecl install mongodb && \
  286. docker-php-ext-enable mongodb \
  287. ;fi \
  288. ;fi
  289. ###########################################################################
  290. # Xhprof:
  291. ###########################################################################
  292. ARG INSTALL_XHPROF=false
  293. RUN set -eux; \
  294. if [ ${INSTALL_XHPROF} = true ]; then \
  295. # Install the php xhprof extension
  296. if [ $(php -r "echo PHP_MAJOR_VERSION;") != 5 ]; then \
  297. pecl install xhprof; \
  298. else \
  299. curl -L -o /tmp/xhprof.tar.gz "https://codeload.github.com/phacility/xhprof/tar.gz/master"; \
  300. mkdir -p /tmp/xhprof; \
  301. tar -C /tmp/xhprof -zxvf /tmp/xhprof.tar.gz --strip 1; \
  302. ( \
  303. cd /tmp/xhprof/extension; \
  304. phpize; \
  305. ./configure; \
  306. make; \
  307. make install; \
  308. ); \
  309. rm -r /tmp/xhprof; \
  310. rm /tmp/xhprof.tar.gz; \
  311. fi; \
  312. docker-php-ext-enable xhprof; \
  313. php -m | grep -q 'xhprof'; \
  314. fi
  315. # if [ ${INSTALL_XHPROF_USE_TIDYWAYS} = true ]; then \
  316. # https://github.com/tideways/php-xhprof-extension
  317. # fi
  318. # COPY ./xhprof.ini /usr/local/etc/php/conf.d
  319. # RUN if [ ${INSTALL_XHPROF} = false ]; then \
  320. # rm /usr/local/etc/php/conf.d/xhprof.ini \
  321. # ;fi
  322. ###########################################################################
  323. # AMQP:
  324. ###########################################################################
  325. ARG INSTALL_AMQP=false
  326. RUN if [ ${INSTALL_AMQP} = true ]; then \
  327. # download and install manually, to make sure it's compatible with ampq installed by pecl later
  328. # install cmake first
  329. apt-get -yqq install cmake && \
  330. curl -L -o /tmp/rabbitmq-c.tar.gz https://github.com/alanxz/rabbitmq-c/archive/master.tar.gz && \
  331. mkdir -p rabbitmq-c && \
  332. tar -C rabbitmq-c -zxvf /tmp/rabbitmq-c.tar.gz --strip 1 && \
  333. cd rabbitmq-c/ && \
  334. mkdir _build && cd _build/ && \
  335. cmake .. && \
  336. cmake --build . --target install && \
  337. # Install the amqp extension
  338. if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
  339. printf "\n" | pecl install amqp-1.11.0beta; \
  340. else \
  341. printf "\n" | pecl install amqp; \
  342. fi && \
  343. docker-php-ext-enable amqp && \
  344. # Install the sockets extension
  345. docker-php-ext-install sockets \
  346. ;fi
  347. ###########################################################################
  348. # CASSANDRA:
  349. ###########################################################################
  350. ARG INSTALL_CASSANDRA=false
  351. RUN if [ ${INSTALL_CASSANDRA} = true ]; then \
  352. if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
  353. echo "PHP Driver for Cassandra is not supported for PHP 8.0."; \
  354. else \
  355. apt-get install libgmp-dev -yqq && \
  356. curl https://downloads.datastax.com/cpp-driver/ubuntu/18.04/dependencies/libuv/v1.35.0/libuv1-dev_1.35.0-1_amd64.deb -o libuv1-dev.deb && \
  357. curl https://downloads.datastax.com/cpp-driver/ubuntu/18.04/dependencies/libuv/v1.35.0/libuv1_1.35.0-1_amd64.deb -o libuv1.deb && \
  358. curl https://downloads.datastax.com/cpp-driver/ubuntu/18.04/cassandra/v2.16.0/cassandra-cpp-driver-dev_2.16.0-1_amd64.deb -o cassandra-cpp-driver-dev.deb && \
  359. curl https://downloads.datastax.com/cpp-driver/ubuntu/18.04/cassandra/v2.16.0/cassandra-cpp-driver_2.16.0-1_amd64.deb -o cassandra-cpp-driver.deb && \
  360. dpkg -i libuv1.deb && \
  361. dpkg -i libuv1-dev.deb && \
  362. dpkg -i cassandra-cpp-driver.deb && \
  363. dpkg -i cassandra-cpp-driver-dev.deb && \
  364. rm libuv1.deb libuv1-dev.deb cassandra-cpp-driver-dev.deb cassandra-cpp-driver.deb && \
  365. cd /usr/src && \
  366. git clone https://github.com/datastax/php-driver.git && \
  367. cd /usr/src/php-driver/ext && \
  368. phpize && \
  369. mkdir /usr/src/php-driver/build && \
  370. cd /usr/src/php-driver/build && \
  371. ../ext/configure > /dev/null && \
  372. make clean > /dev/null && \
  373. make > /dev/null 2>&1 && \
  374. make install && \
  375. echo "extension=cassandra.so" >> /etc/php/${LARADOCK_PHP_VERSION}/mods-available/cassandra.ini && \
  376. ln -s /etc/php/${LARADOCK_PHP_VERSION}/mods-available/cassandra.ini /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/30-cassandra.ini; \
  377. fi \
  378. ;fi
  379. ###########################################################################
  380. # GEARMAN:
  381. ###########################################################################
  382. ARG INSTALL_GEARMAN=false
  383. RUN if [ ${INSTALL_GEARMAN} = true ]; then \
  384. apt-get -y install libgearman-dev && \
  385. cd /tmp && \
  386. curl -L https://github.com/wcgallego/pecl-gearman/archive/gearman-2.0.5.zip -O && \
  387. unzip gearman-2.0.5.zip && \
  388. mv pecl-gearman-gearman-2.0.5 pecl-gearman && \
  389. cd /tmp/pecl-gearman && \
  390. phpize && \
  391. ./configure && \
  392. make -j$(nproc) && \
  393. make install && \
  394. cd / && \
  395. rm /tmp/gearman-2.0.5.zip && \
  396. rm -r /tmp/pecl-gearman && \
  397. docker-php-ext-enable gearman \
  398. ;fi
  399. ###########################################################################
  400. # pcntl
  401. ###########################################################################
  402. ARG INSTALL_PCNTL=false
  403. RUN if [ ${INSTALL_PCNTL} = true ]; then \
  404. # Installs pcntl, helpful for running Horizon
  405. docker-php-ext-install pcntl \
  406. ;fi
  407. ###########################################################################
  408. # bcmath:
  409. ###########################################################################
  410. ARG INSTALL_BCMATH=false
  411. RUN if [ ${INSTALL_BCMATH} = true ]; then \
  412. # Install the bcmath extension
  413. docker-php-ext-install bcmath \
  414. ;fi
  415. ###########################################################################
  416. # PHP Memcached:
  417. ###########################################################################
  418. ARG INSTALL_MEMCACHED=false
  419. RUN if [ ${INSTALL_MEMCACHED} = true ]; then \
  420. # Install the php memcached extension
  421. if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
  422. pecl install memcached-2.2.0; \
  423. else \
  424. pecl install memcached-3.1.3; \
  425. fi \
  426. && docker-php-ext-enable memcached \
  427. ;fi
  428. ###########################################################################
  429. # Exif:
  430. ###########################################################################
  431. ARG INSTALL_EXIF=false
  432. RUN if [ ${INSTALL_EXIF} = true ]; then \
  433. # Enable Exif PHP extentions requirements
  434. docker-php-ext-install exif \
  435. ;fi
  436. ###########################################################################
  437. # PHP Aerospike:
  438. ###########################################################################
  439. USER root
  440. ARG INSTALL_AEROSPIKE=false
  441. RUN set -xe; \
  442. if [ ${INSTALL_AEROSPIKE} = true ]; then \
  443. # Fix dependencies for PHPUnit within aerospike extension
  444. apt-get -y install sudo wget && \
  445. # Install the php aerospike extension
  446. if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
  447. curl -L -o /tmp/aerospike-client-php.tar.gz https://github.com/aerospike/aerospike-client-php5/archive/master.tar.gz; \
  448. else \
  449. curl -L -o /tmp/aerospike-client-php.tar.gz https://github.com/aerospike/aerospike-client-php/archive/master.tar.gz; \
  450. fi \
  451. && mkdir -p /tmp/aerospike-client-php \
  452. && tar -C /tmp/aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \
  453. && \
  454. if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
  455. ( \
  456. cd /tmp/aerospike-client-php/src/aerospike \
  457. && phpize \
  458. && ./build.sh \
  459. && make install \
  460. ) \
  461. else \
  462. ( \
  463. cd /tmp/aerospike-client-php/src \
  464. && phpize \
  465. && ./build.sh \
  466. && make install \
  467. ) \
  468. fi \
  469. && rm /tmp/aerospike-client-php.tar.gz \
  470. && docker-php-ext-enable aerospike \
  471. ;fi
  472. ###########################################################################
  473. # PHP OCI8:
  474. ###########################################################################
  475. ARG INSTALL_OCI8=false
  476. ARG ORACLE_INSTANT_CLIENT_MIRROR=https://github.com/diogomascarenha/oracle-instantclient/raw/master/
  477. ENV LD_LIBRARY_PATH="/opt/oracle/instantclient_12_1"
  478. ENV OCI_HOME="/opt/oracle/instantclient_12_1"
  479. ENV OCI_LIB_DIR="/opt/oracle/instantclient_12_1"
  480. ENV OCI_INCLUDE_DIR="/opt/oracle/instantclient_12_1/sdk/include"
  481. ENV OCI_VERSION=12
  482. RUN if [ ${INSTALL_OCI8} = true ]; then \
  483. # Install wget
  484. apt-get update && apt-get install --no-install-recommends -y wget \
  485. # Install Oracle Instantclient
  486. && mkdir /opt/oracle \
  487. && cd /opt/oracle \
  488. && wget ${ORACLE_INSTANT_CLIENT_MIRROR}instantclient-basic-linux.x64-12.1.0.2.0.zip \
  489. && wget ${ORACLE_INSTANT_CLIENT_MIRROR}instantclient-sdk-linux.x64-12.1.0.2.0.zip \
  490. && unzip /opt/oracle/instantclient-basic-linux.x64-12.1.0.2.0.zip -d /opt/oracle \
  491. && unzip /opt/oracle/instantclient-sdk-linux.x64-12.1.0.2.0.zip -d /opt/oracle \
  492. && ln -s /opt/oracle/instantclient_12_1/libclntsh.so.12.1 /opt/oracle/instantclient_12_1/libclntsh.so \
  493. && ln -s /opt/oracle/instantclient_12_1/libclntshcore.so.12.1 /opt/oracle/instantclient_12_1/libclntshcore.so \
  494. && ln -s /opt/oracle/instantclient_12_1/libocci.so.12.1 /opt/oracle/instantclient_12_1/libocci.so \
  495. && rm -rf /opt/oracle/*.zip \
  496. # Install PHP extensions deps
  497. && apt-get update \
  498. && apt-get install --no-install-recommends -y \
  499. libaio-dev \
  500. freetds-dev && \
  501. # Install PHP extensions
  502. if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
  503. echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8-2.0.10; \
  504. else \
  505. echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8-2.2.0; \
  506. fi \
  507. && docker-php-ext-configure pdo_oci --with-pdo-oci=instantclient,/opt/oracle/instantclient_12_1,12.1 \
  508. && docker-php-ext-configure pdo_dblib --with-libdir=/lib/x86_64-linux-gnu \
  509. && docker-php-ext-install \
  510. pdo_oci \
  511. && docker-php-ext-enable \
  512. oci8 \
  513. ;fi
  514. ###########################################################################
  515. # IonCube Loader:
  516. ###########################################################################
  517. ARG INSTALL_IONCUBE=false
  518. RUN if [ ${INSTALL_IONCUBE} = true ]; then \
  519. # Install the php ioncube loader
  520. curl -L -o /tmp/ioncube_loaders_lin_x86-64.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz \
  521. && tar zxpf /tmp/ioncube_loaders_lin_x86-64.tar.gz -C /tmp \
  522. && mv /tmp/ioncube/ioncube_loader_lin_${LARADOCK_PHP_VERSION}.so $(php -r "echo ini_get('extension_dir');")/ioncube_loader.so \
  523. && printf "zend_extension=ioncube_loader.so\n" > $PHP_INI_DIR/conf.d/0ioncube.ini \
  524. && rm -rf /tmp/ioncube* \
  525. ;fi
  526. ###########################################################################
  527. # Opcache:
  528. ###########################################################################
  529. ARG INSTALL_OPCACHE=false
  530. RUN if [ ${INSTALL_OPCACHE} = true ]; then \
  531. docker-php-ext-install opcache \
  532. ;fi
  533. # Copy opcache configration
  534. COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini
  535. ###########################################################################
  536. # Mysqli Modifications:
  537. ###########################################################################
  538. ARG INSTALL_MYSQLI=false
  539. RUN if [ ${INSTALL_MYSQLI} = true ]; then \
  540. docker-php-ext-install mysqli \
  541. ;fi
  542. ###########################################################################
  543. # Human Language and Character Encoding Support:
  544. ###########################################################################
  545. ARG INSTALL_INTL=false
  546. RUN if [ ${INSTALL_INTL} = true ]; then \
  547. # Install intl and requirements
  548. apt-get install -y zlib1g-dev libicu-dev g++ && \
  549. docker-php-ext-configure intl && \
  550. docker-php-ext-install intl \
  551. ;fi
  552. ###########################################################################
  553. # GHOSTSCRIPT:
  554. ###########################################################################
  555. ARG INSTALL_GHOSTSCRIPT=false
  556. RUN if [ ${INSTALL_GHOSTSCRIPT} = true ]; then \
  557. # Install the ghostscript extension
  558. # for PDF editing
  559. apt-get install -y \
  560. poppler-utils \
  561. ghostscript \
  562. ;fi
  563. ###########################################################################
  564. # LDAP:
  565. ###########################################################################
  566. ARG INSTALL_LDAP=false
  567. RUN if [ ${INSTALL_LDAP} = true ]; then \
  568. apt-get install -y libldap2-dev && \
  569. docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && \
  570. docker-php-ext-install ldap \
  571. ;fi
  572. ###########################################################################
  573. # SQL SERVER:
  574. ###########################################################################
  575. ARG INSTALL_MSSQL=false
  576. RUN set -eux; \
  577. if [ ${INSTALL_MSSQL} = true ]; then \
  578. if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
  579. apt-get -y install freetds-dev libsybdb5 \
  580. && ln -s /usr/lib/x86_64-linux-gnu/libsybdb.so /usr/lib/libsybdb.so \
  581. && docker-php-ext-install mssql pdo_dblib \
  582. && php -m | grep -q 'mssql' \
  583. && php -m | grep -q 'pdo_dblib' \
  584. ;else \
  585. ###########################################################################
  586. # Ref from https://github.com/Microsoft/msphpsql/wiki/Dockerfile-for-adding-pdo_sqlsrv-and-sqlsrv-to-official-php-image
  587. ###########################################################################
  588. # Add Microsoft repo for Microsoft ODBC Driver 13 for Linux
  589. apt-get install -y apt-transport-https gnupg \
  590. && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
  591. && curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list \
  592. && apt-get update -yqq \
  593. # Install Dependencies
  594. && ACCEPT_EULA=Y apt-get install -y unixodbc unixodbc-dev libgss3 odbcinst msodbcsql17 locales \
  595. && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \
  596. # link local aliases
  597. && ln -sfn /etc/locale.alias /usr/share/locale/locale.alias \
  598. && locale-gen \
  599. # Install pdo_sqlsrv and sqlsrv from PECL. Replace pdo_sqlsrv-4.1.8preview with preferred version.
  600. && if [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ]; then \
  601. pecl install pdo_sqlsrv-5.3.0 sqlsrv-5.3.0 \
  602. ;else \
  603. pecl install pdo_sqlsrv sqlsrv \
  604. ;fi \
  605. && docker-php-ext-enable pdo_sqlsrv sqlsrv \
  606. && php -m | grep -q 'pdo_sqlsrv' \
  607. && php -m | grep -q 'sqlsrv' \
  608. ;fi \
  609. ;fi
  610. ###########################################################################
  611. # Image optimizers:
  612. ###########################################################################
  613. USER root
  614. ARG INSTALL_IMAGE_OPTIMIZERS=false
  615. RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \
  616. apt-get install -y jpegoptim optipng pngquant gifsicle \
  617. ;fi
  618. ###########################################################################
  619. # ImageMagick:
  620. ###########################################################################
  621. USER root
  622. ARG INSTALL_IMAGEMAGICK=false
  623. ARG IMAGEMAGICK_VERSION=latest
  624. ENV IMAGEMAGICK_VERSION ${IMAGEMAGICK_VERSION}
  625. RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \
  626. apt-get install -y libmagickwand-dev imagemagick && \
  627. if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
  628. apt-get install -y git && \
  629. cd /tmp && \
  630. if [ ${IMAGEMAGICK_VERSION} = "latest" ]; then \
  631. git clone https://github.com/Imagick/imagick; \
  632. else \
  633. git clone --branch ${IMAGEMAGICK_VERSION} https://github.com/Imagick/imagick; \
  634. fi && \
  635. cd imagick && \
  636. phpize && \
  637. ./configure && \
  638. make && \
  639. make install && \
  640. rm -r /tmp/imagick; \
  641. else \
  642. pecl install imagick; \
  643. fi && \
  644. docker-php-ext-enable imagick \
  645. ;fi
  646. ###########################################################################
  647. # SMB:
  648. ###########################################################################
  649. ARG INSTALL_SMB=false
  650. RUN if [ ${INSTALL_SMB} = true ]; then \
  651. apt-get install -y smbclient php-smbclient coreutils \
  652. ;fi
  653. ###########################################################################
  654. # IMAP:
  655. ###########################################################################
  656. ARG INSTALL_IMAP=false
  657. RUN if [ ${INSTALL_IMAP} = true ]; then \
  658. apt-get install -y libc-client-dev libkrb5-dev && \
  659. docker-php-ext-configure imap --with-kerberos --with-imap-ssl && \
  660. docker-php-ext-install imap \
  661. ;fi
  662. ###########################################################################
  663. # Calendar:
  664. ###########################################################################
  665. USER root
  666. ARG INSTALL_CALENDAR=false
  667. RUN if [ ${INSTALL_CALENDAR} = true ]; then \
  668. docker-php-ext-configure calendar && \
  669. docker-php-ext-install calendar \
  670. ;fi
  671. ###########################################################################
  672. # Phalcon:
  673. ###########################################################################
  674. ARG INSTALL_PHALCON=false
  675. ARG LARADOCK_PHALCON_VERSION
  676. ENV LARADOCK_PHALCON_VERSION ${LARADOCK_PHALCON_VERSION}
  677. # Copy phalcon configration
  678. COPY ./phalcon.ini /usr/local/etc/php/conf.d/phalcon.ini.disable
  679. RUN if [ $INSTALL_PHALCON = true ]; then \
  680. apt-get update && apt-get install -y unzip libpcre3-dev gcc make re2c git automake autoconf\
  681. && git clone https://github.com/jbboehr/php-psr.git \
  682. && cd php-psr \
  683. && phpize \
  684. && ./configure \
  685. && make \
  686. && make test \
  687. && make install \
  688. && curl -L -o /tmp/cphalcon.zip https://github.com/phalcon/cphalcon/archive/v${LARADOCK_PHALCON_VERSION}.zip \
  689. && unzip -d /tmp/ /tmp/cphalcon.zip \
  690. && cd /tmp/cphalcon-${LARADOCK_PHALCON_VERSION}/build \
  691. && ./install \
  692. && mv /usr/local/etc/php/conf.d/phalcon.ini.disable /usr/local/etc/php/conf.d/phalcon.ini \
  693. && rm -rf /tmp/cphalcon* \
  694. ;fi
  695. ###########################################################################
  696. # APCU:
  697. ###########################################################################
  698. ARG INSTALL_APCU=false
  699. RUN if [ ${INSTALL_APCU} = true ]; then \
  700. if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
  701. pecl install -a apcu-4.0.11; \
  702. else \
  703. pecl install apcu; \
  704. fi && \
  705. docker-php-ext-enable apcu \
  706. ;fi
  707. ###########################################################################
  708. # YAML:
  709. ###########################################################################
  710. USER root
  711. ARG INSTALL_YAML=false
  712. RUN if [ ${INSTALL_YAML} = true ]; then \
  713. apt-get install libyaml-dev -y ; \
  714. if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
  715. pecl install -a yaml-1.3.2; \
  716. else \
  717. pecl install yaml; \
  718. fi && \
  719. docker-php-ext-enable yaml \
  720. ;fi
  721. ###########################################################################
  722. # RDKAFKA:
  723. ###########################################################################
  724. ARG INSTALL_RDKAFKA=false
  725. RUN if [ ${INSTALL_RDKAFKA} = true ]; then \
  726. apt-get install -y librdkafka-dev && \
  727. pecl install rdkafka && \
  728. docker-php-ext-enable rdkafka \
  729. ;fi
  730. ###########################################################################
  731. # GETTEXT:
  732. ###########################################################################
  733. ARG INSTALL_GETTEXT=false
  734. RUN if [ ${INSTALL_GETTEXT} = true ]; then \
  735. apt-get install -y zlib1g-dev libicu-dev g++ libpq-dev libssl-dev gettext && \
  736. docker-php-ext-install gettext \
  737. ;fi
  738. ###########################################################################
  739. # Install additional locales:
  740. ###########################################################################
  741. ARG INSTALL_ADDITIONAL_LOCALES=false
  742. ARG ADDITIONAL_LOCALES
  743. RUN if [ ${INSTALL_ADDITIONAL_LOCALES} = true ]; then \
  744. apt-get install -y locales \
  745. && echo '' >> /usr/share/locale/locale.alias \
  746. && temp="${ADDITIONAL_LOCALES%\"}" \
  747. && temp="${temp#\"}" \
  748. && for i in ${temp}; do sed -i "/$i/s/^#//g" /etc/locale.gen; done \
  749. && locale-gen \
  750. ;fi
  751. ###########################################################################
  752. # MySQL Client:
  753. ###########################################################################
  754. USER root
  755. ARG INSTALL_MYSQL_CLIENT=false
  756. RUN if [ ${INSTALL_MYSQL_CLIENT} = true ]; then \
  757. apt-get -y install default-mysql-client \
  758. ;fi
  759. ###########################################################################
  760. # ping:
  761. ###########################################################################
  762. USER root
  763. ARG INSTALL_PING=false
  764. RUN if [ ${INSTALL_PING} = true ]; then \
  765. apt-get -y install inetutils-ping \
  766. ;fi
  767. ###########################################################################
  768. # sshpass:
  769. ###########################################################################
  770. USER root
  771. ARG INSTALL_SSHPASS=false
  772. RUN if [ ${INSTALL_SSHPASS} = true ]; then \
  773. apt-get -y install sshpass \
  774. ;fi
  775. ###########################################################################
  776. # Docker Client:
  777. ###########################################################################
  778. USER root
  779. ARG INSTALL_DOCKER_CLIENT=false
  780. RUN if [ ${INSTALL_DOCKER_CLIENT} = true ]; then \
  781. curl -sS https://download.docker.com/linux/static/stable/x86_64/docker-20.10.3.tgz -o /tmp/docker.tar.gz && \
  782. tar -xzf /tmp/docker.tar.gz -C /tmp/ && \
  783. cp /tmp/docker/docker* /usr/local/bin && \
  784. chmod +x /usr/local/bin/docker* \
  785. ;fi
  786. ###########################################################################
  787. # FFMPEG:
  788. ###########################################################################
  789. USER root
  790. ARG INSTALL_FFMPEG=false
  791. RUN if [ ${INSTALL_FFMPEG} = true ]; then \
  792. apt-get -y install ffmpeg \
  793. ;fi
  794. ###########################################################################
  795. # BBC Audio Waveform Image Generator:
  796. ###########################################################################
  797. USER root
  798. ARG INSTALL_AUDIOWAVEFORM=false
  799. RUN if [ ${INSTALL_AUDIOWAVEFORM} = true ]; then \
  800. apt-get -y install git wget make cmake gcc g++ libmad0-dev libid3tag0-dev libsndfile1-dev libgd-dev libboost-filesystem-dev libboost-program-options-dev libboost-regex-dev \
  801. && git clone https://github.com/bbc/audiowaveform.git \
  802. && cd audiowaveform \
  803. && wget https://github.com/google/googletest/archive/release-1.10.0.tar.gz \
  804. && tar xzf release-1.10.0.tar.gz \
  805. && ln -s googletest-release-1.10.0/googletest googletest \
  806. && ln -s googletest-release-1.10.0/googlemock googlemock \
  807. && mkdir build \
  808. && cd build \
  809. && cmake .. \
  810. && make \
  811. && make install \
  812. ;fi
  813. #####################################
  814. # wkhtmltopdf:
  815. #####################################
  816. USER root
  817. ARG INSTALL_WKHTMLTOPDF=false
  818. RUN if [ ${INSTALL_WKHTMLTOPDF} = true ]; then \
  819. apt-get install -y \
  820. libxrender1 \
  821. libfontconfig1 \
  822. libx11-dev \
  823. libjpeg62 \
  824. libxtst6 \
  825. fontconfig \
  826. libjpeg62-turbo \
  827. xfonts-base \
  828. xfonts-75dpi \
  829. wget \
  830. && wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.stretch_amd64.deb \
  831. && dpkg -i wkhtmltox_0.12.6-1.stretch_amd64.deb \
  832. && apt -f install \
  833. ;fi
  834. ###########################################################################
  835. # Mailparse extension:
  836. ###########################################################################
  837. ARG INSTALL_MAILPARSE=false
  838. RUN if [ ${INSTALL_MAILPARSE} = true ]; then \
  839. # Install mailparse extension
  840. printf "\n" | pecl install -o -f mailparse \
  841. && rm -rf /tmp/pear \
  842. && docker-php-ext-enable mailparse \
  843. ;fi
  844. ###########################################################################
  845. # CacheTool:
  846. ###########################################################################
  847. ARG INSTALL_CACHETOOL=false
  848. RUN if [ ${INSTALL_CACHETOOL} = true ]; then \
  849. if [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && [ $(php -r "echo PHP_MINOR_VERSION;") -ge 1 ]; then \
  850. curl -sO http://gordalina.github.io/cachetool/downloads/cachetool.phar; \
  851. else \
  852. curl http://gordalina.github.io/cachetool/downloads/cachetool-3.2.1.phar -o cachetool.phar; \
  853. fi && \
  854. chmod +x cachetool.phar && \
  855. mv cachetool.phar /usr/local/bin/cachetool \
  856. ;fi
  857. ###########################################################################
  858. # XMLRPC:
  859. ###########################################################################
  860. ARG INSTALL_XMLRPC=false
  861. RUN if [ ${INSTALL_XMLRPC} = true ]; then \
  862. apt-get -yq install libxml2-dev; \
  863. if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
  864. pecl install xmlrpc-1.0.0RC2; \
  865. docker-php-ext-enable xmlrpc; \
  866. else \
  867. docker-php-ext-install xmlrpc; \
  868. fi \
  869. ;fi
  870. ###########################################################################
  871. # New Relic for PHP:
  872. ###########################################################################
  873. ARG NEW_RELIC=${NEW_RELIC}
  874. ARG NEW_RELIC_KEY=${NEW_RELIC_KEY}
  875. ARG NEW_RELIC_APP_NAME=${NEW_RELIC_APP_NAME}
  876. RUN if [ ${NEW_RELIC} = true ]; then \
  877. curl -L http://download.newrelic.com/php_agent/archive/9.9.0.260/newrelic-php5-9.9.0.260-linux.tar.gz | tar -C /tmp -zx && \
  878. export NR_INSTALL_USE_CP_NOT_LN=1 && \
  879. export NR_INSTALL_SILENT=1 && \
  880. /tmp/newrelic-php5-*/newrelic-install install && \
  881. rm -rf /tmp/newrelic-php5-* /tmp/nrinstall* && \
  882. sed -i \
  883. -e 's/"REPLACE_WITH_REAL_KEY"/"${NEW_RELIC_KEY}"/' \
  884. -e 's/newrelic.appname = "PHP Application"/newrelic.appname = "${NEW_RELIC_APP_NAME}"/' \
  885. -e 's/;newrelic.daemon.app_connect_timeout =.*/newrelic.daemon.app_connect_timeout=15s/' \
  886. -e 's/;newrelic.daemon.start_timeout =.*/newrelic.daemon.start_timeout=5s/' \
  887. /usr/local/etc/php/conf.d/newrelic.ini \
  888. ;fi
  889. ###########################################################################
  890. # Downgrade Openssl:
  891. ###########################################################################
  892. ARG DOWNGRADE_OPENSSL_TLS_AND_SECLEVEL=false
  893. RUN if [ ${DOWNGRADE_OPENSSL_TLS_AND_SECLEVEL} = true ]; then \
  894. sed -i 's,^\(MinProtocol[ ]*=\).*,\1'TLSv1.2',g' /etc/ssl/openssl.cnf \
  895. && \
  896. sed -i 's,^\(CipherString[ ]*=\).*,\1'DEFAULT@SECLEVEL=1',g' /etc/ssl/openssl.cnf\
  897. ;fi
  898. ###########################################################################
  899. # Check PHP version:
  900. ###########################################################################
  901. RUN set -xe; php -v | head -n 1 | grep -q "PHP ${LARADOCK_PHP_VERSION}."
  902. #
  903. #--------------------------------------------------------------------------
  904. # Final Touch
  905. #--------------------------------------------------------------------------
  906. #
  907. COPY ./laravel.ini /usr/local/etc/php/conf.d
  908. COPY ./xlaravel.pool.conf /usr/local/etc/php-fpm.d/
  909. USER root
  910. # Clean up
  911. RUN apt-get clean && \
  912. rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
  913. rm /var/log/lastlog /var/log/faillog
  914. # Configure non-root user.
  915. ARG PUID=1000
  916. ENV PUID ${PUID}
  917. ARG PGID=1000
  918. ENV PGID ${PGID}
  919. RUN groupmod -o -g ${PGID} www-data && \
  920. usermod -o -u ${PUID} -g www-data www-data
  921. # Adding the faketime library to the preload file needs to be done last
  922. # otherwise it will preload it for all commands that follow in this file
  923. RUN if [ ${INSTALL_FAKETIME} = true ]; then \
  924. echo "/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1" > /etc/ld.so.preload \
  925. ;fi
  926. # Configure locale.
  927. ARG LOCALE=POSIX
  928. ENV LC_ALL ${LOCALE}
  929. WORKDIR /var/www
  930. CMD ["php-fpm"]
  931. EXPOSE 9000