2022-12-14 08:01:00 -06:00
|
|
|
FROM php:8.2-alpine3.17
|
2018-11-24 01:43:48 -06:00
|
|
|
MAINTAINER Alejandro Celaya <alejandro@alejandrocelaya.com>
|
|
|
|
|
2021-12-07 03:43:36 -06:00
|
|
|
ENV APCU_VERSION 5.1.21
|
2021-01-30 02:31:08 -06:00
|
|
|
ENV INOTIFY_VERSION 3.0.0
|
2023-04-14 01:58:54 -05:00
|
|
|
ENV OPENSWOOLE_VERSION 22.0.0
|
2022-08-05 09:31:15 -05:00
|
|
|
ENV PDO_SQLSRV_VERSION 5.10.1
|
2022-12-10 12:15:38 -06:00
|
|
|
ENV MS_ODBC_DOWNLOAD 'b/9/f/b9f3cce4-3925-46d4-9f46-da08869c6486'
|
|
|
|
ENV MS_ODBC_SQL_VERSION 18_18.1.1.1
|
2019-02-02 03:53:34 -06:00
|
|
|
|
2018-11-24 01:43:48 -06:00
|
|
|
RUN apk update
|
|
|
|
|
|
|
|
# Install common php extensions
|
|
|
|
RUN docker-php-ext-install pdo_mysql
|
|
|
|
RUN docker-php-ext-install calendar
|
|
|
|
|
2019-12-17 04:21:47 -06:00
|
|
|
RUN apk add --no-cache oniguruma-dev
|
|
|
|
RUN docker-php-ext-install mbstring
|
|
|
|
|
2019-11-15 15:05:34 -06:00
|
|
|
RUN apk add --no-cache sqlite-libs
|
|
|
|
RUN apk add --no-cache sqlite-dev
|
2018-11-24 01:43:48 -06:00
|
|
|
RUN docker-php-ext-install pdo_sqlite
|
|
|
|
|
2019-11-15 15:05:34 -06:00
|
|
|
RUN apk add --no-cache icu-dev
|
2019-11-16 02:46:42 -06:00
|
|
|
RUN docker-php-ext-install intl
|
2018-11-24 01:43:48 -06:00
|
|
|
|
2019-11-15 15:05:34 -06:00
|
|
|
RUN apk add --no-cache libzip-dev zlib-dev
|
2018-11-24 01:43:48 -06:00
|
|
|
RUN docker-php-ext-install zip
|
|
|
|
|
2019-11-15 15:05:34 -06:00
|
|
|
RUN apk add --no-cache libpng-dev
|
2018-11-24 01:43:48 -06:00
|
|
|
RUN docker-php-ext-install gd
|
|
|
|
|
2019-03-05 06:39:45 -06:00
|
|
|
RUN apk add --no-cache postgresql-dev
|
|
|
|
RUN docker-php-ext-install pdo_pgsql
|
|
|
|
|
2022-12-14 08:01:00 -06:00
|
|
|
RUN apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS linux-headers && \
|
|
|
|
docker-php-ext-install sockets && \
|
|
|
|
apk del .phpize-deps
|
2021-12-11 10:07:40 -06:00
|
|
|
RUN docker-php-ext-install bcmath
|
|
|
|
|
2018-11-24 01:43:48 -06:00
|
|
|
# Install APCu extension
|
2019-02-02 03:53:34 -06:00
|
|
|
ADD https://pecl.php.net/get/apcu-$APCU_VERSION.tgz /tmp/apcu.tar.gz
|
2021-01-30 02:31:08 -06:00
|
|
|
RUN mkdir -p /usr/src/php/ext/apcu \
|
|
|
|
&& tar xf /tmp/apcu.tar.gz -C /usr/src/php/ext/apcu --strip-components=1 \
|
|
|
|
&& docker-php-ext-configure apcu \
|
|
|
|
&& docker-php-ext-install apcu \
|
|
|
|
&& rm /tmp/apcu.tar.gz \
|
|
|
|
&& rm /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini \
|
|
|
|
&& echo extension=apcu.so > /usr/local/etc/php/conf.d/20-php-ext-apcu.ini
|
2018-11-24 01:43:48 -06:00
|
|
|
|
2019-02-24 06:22:44 -06:00
|
|
|
# Install inotify extension
|
|
|
|
ADD https://pecl.php.net/get/inotify-$INOTIFY_VERSION.tgz /tmp/inotify.tar.gz
|
2021-01-30 02:31:08 -06:00
|
|
|
RUN mkdir -p /usr/src/php/ext/inotify \
|
|
|
|
&& tar xf /tmp/inotify.tar.gz -C /usr/src/php/ext/inotify --strip-components=1 \
|
|
|
|
&& docker-php-ext-configure inotify \
|
|
|
|
&& docker-php-ext-install inotify \
|
|
|
|
&& rm /tmp/inotify.tar.gz
|
2019-02-24 06:22:44 -06:00
|
|
|
|
2021-12-05 03:08:10 -06:00
|
|
|
# Install openswoole, pcov and mssql driver
|
2022-12-10 12:15:38 -06:00
|
|
|
RUN wget https://download.microsoft.com/download/${MS_ODBC_DOWNLOAD}/msodbcsql${MS_ODBC_SQL_VERSION}-1_amd64.apk && \
|
|
|
|
apk add --allow-untrusted msodbcsql${MS_ODBC_SQL_VERSION}-1_amd64.apk && \
|
2020-02-03 14:20:40 -06:00
|
|
|
apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS unixodbc-dev && \
|
2021-12-05 03:08:10 -06:00
|
|
|
pecl install openswoole-${OPENSWOOLE_VERSION} pdo_sqlsrv-${PDO_SQLSRV_VERSION} pcov && \
|
|
|
|
docker-php-ext-enable openswoole pdo_sqlsrv pcov && \
|
2020-02-03 14:20:40 -06:00
|
|
|
apk del .phpize-deps && \
|
2022-12-10 12:15:38 -06:00
|
|
|
rm msodbcsql${MS_ODBC_SQL_VERSION}-1_amd64.apk
|
2018-11-24 01:43:48 -06:00
|
|
|
|
|
|
|
# Install composer
|
2020-10-25 11:59:37 -05:00
|
|
|
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
|
2018-11-24 01:43:48 -06:00
|
|
|
|
|
|
|
# Make home directory writable by anyone
|
|
|
|
RUN chmod 777 /home
|
|
|
|
|
|
|
|
VOLUME /home/shlink
|
|
|
|
WORKDIR /home/shlink
|
|
|
|
|
2021-12-05 03:08:10 -06:00
|
|
|
# Expose openswoole port
|
2018-11-24 01:43:48 -06:00
|
|
|
EXPOSE 8080
|
|
|
|
|
2019-07-23 09:36:56 -05:00
|
|
|
CMD \
|
|
|
|
# Install dependencies if the vendor dir does not exist
|
|
|
|
if [[ ! -d "./vendor" ]]; then /usr/local/bin/composer install ; fi && \
|
2021-12-05 03:08:10 -06:00
|
|
|
# When restarting the container, openswoole might think it is already in execution
|
2018-11-25 05:44:49 -06:00
|
|
|
# This forces the app to be started every second until the exit code is 0
|
2021-01-14 13:19:38 -06:00
|
|
|
until php ./vendor/bin/laminas mezzio:swoole:start; do sleep 1 ; done
|