2020-11-02 00:12:43 +01:00
|
|
|
FROM php:7.4-zts
|
2020-03-09 00:42:17 +01:00
|
|
|
|
2020-06-07 22:56:42 +02:00
|
|
|
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.7.3/wait /usr/local/bin/docker-compose-wait
|
|
|
|
|
2020-05-11 23:14:38 +02:00
|
|
|
RUN apt-get update && apt-get upgrade -y \
|
|
|
|
&& apt-get install apt-utils -y \
|
2020-11-04 13:04:34 +01:00
|
|
|
# Install main extension
|
2020-06-07 21:03:19 +02:00
|
|
|
&& apt-get install git zip vim libzip-dev libgmp-dev libevent-dev libssl-dev libnghttp2-dev libffi-dev -y \
|
2020-08-14 20:40:48 +02:00
|
|
|
&& docker-php-ext-install -j$(nproc) sockets zip gmp pcntl bcmath ffi \
|
2020-11-04 13:04:34 +01:00
|
|
|
# Install additional extension
|
|
|
|
&& mkdir -p /usr/src/php/ext/ && cd /usr/src/php/ext/ \
|
2020-11-04 11:48:54 +01:00
|
|
|
&& pecl bundle event \
|
|
|
|
&& pecl bundle ev \
|
|
|
|
&& pecl bundle parallel \
|
|
|
|
&& docker-php-ext-configure event --with-event-core --with-event-extra --with-event-pthreads \
|
|
|
|
&& docker-php-ext-install -j$(nproc) ev event parallel \
|
2020-11-04 13:04:34 +01:00
|
|
|
# Install composer
|
|
|
|
&& chmod +x /usr/local/bin/docker-compose-wait \
|
|
|
|
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
|
|
|
|
# Cleanup
|
2020-05-11 23:14:38 +02:00
|
|
|
&& docker-php-source delete \
|
|
|
|
&& apt-get autoremove --purge -y && apt-get autoclean -y && apt-get clean -y \
|
2020-11-04 13:04:34 +01:00
|
|
|
&& rm -rf /usr/src
|
2020-11-04 11:48:54 +01:00
|
|
|
|
|
|
|
COPY . /app
|
|
|
|
WORKDIR /app
|
|
|
|
|
2020-11-04 13:04:34 +01:00
|
|
|
RUN cp -a docker/php/conf.d/. "$PHP_INI_DIR/conf.d/" \
|
2020-08-14 20:40:48 +02:00
|
|
|
&& composer install --no-dev \
|
2020-05-11 23:14:38 +02:00
|
|
|
&& composer clear
|
2020-03-09 00:42:17 +01:00
|
|
|
|
2020-03-09 22:38:56 +01:00
|
|
|
VOLUME ["/app/sessions"]
|
2020-03-09 00:42:17 +01:00
|
|
|
|
2020-06-07 21:03:19 +02:00
|
|
|
#Creating symlink to save .env in volume
|
|
|
|
RUN touch '/app/sessions/.env.docker' && \
|
|
|
|
ln -s '/app/sessions/.env.docker' '/app/.env.docker'
|
|
|
|
|
2020-03-09 00:42:17 +01:00
|
|
|
EXPOSE 9503
|
|
|
|
|
2020-06-25 00:33:18 +02:00
|
|
|
ENTRYPOINT docker-compose-wait && php server.php -e=.env.docker --docker -s=*
|