mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-27 20:11:34 +03:00
Merge pull request #1248 from acelaya-forks/feature/openswoole
Feature/openswoole
This commit is contained in:
commit
5a90a5e6c7
11 changed files with 33 additions and 33 deletions
20
.github/workflows/ci.yml
vendored
20
.github/workflows/ci.yml
vendored
|
@ -21,7 +21,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php-version }}
|
php-version: ${{ matrix.php-version }}
|
||||||
tools: composer
|
tools: composer
|
||||||
extensions: swoole-4.7.1
|
extensions: openswoole-4.8.1
|
||||||
coverage: none
|
coverage: none
|
||||||
- run: composer install --no-interaction --prefer-dist
|
- run: composer install --no-interaction --prefer-dist
|
||||||
- run: composer cs
|
- run: composer cs
|
||||||
|
@ -39,7 +39,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php-version }}
|
php-version: ${{ matrix.php-version }}
|
||||||
tools: composer
|
tools: composer
|
||||||
extensions: swoole-4.7.1
|
extensions: openswoole-4.8.1
|
||||||
coverage: none
|
coverage: none
|
||||||
- run: composer install --no-interaction --prefer-dist
|
- run: composer install --no-interaction --prefer-dist
|
||||||
- run: composer stan
|
- run: composer stan
|
||||||
|
@ -58,7 +58,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php-version }}
|
php-version: ${{ matrix.php-version }}
|
||||||
tools: composer
|
tools: composer
|
||||||
extensions: swoole-4.7.1
|
extensions: openswoole-4.8.1
|
||||||
coverage: pcov
|
coverage: pcov
|
||||||
ini-values: pcov.directory=module
|
ini-values: pcov.directory=module
|
||||||
- if: ${{ matrix.php-version == '8.1' }}
|
- if: ${{ matrix.php-version == '8.1' }}
|
||||||
|
@ -88,7 +88,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php-version }}
|
php-version: ${{ matrix.php-version }}
|
||||||
tools: composer
|
tools: composer
|
||||||
extensions: swoole-4.7.1
|
extensions: openswoole-4.8.1
|
||||||
coverage: pcov
|
coverage: pcov
|
||||||
ini-values: pcov.directory=module
|
ini-values: pcov.directory=module
|
||||||
- if: ${{ matrix.php-version == '8.1' }}
|
- if: ${{ matrix.php-version == '8.1' }}
|
||||||
|
@ -120,7 +120,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php-version }}
|
php-version: ${{ matrix.php-version }}
|
||||||
tools: composer
|
tools: composer
|
||||||
extensions: swoole-4.7.1
|
extensions: openswoole-4.8.1
|
||||||
coverage: none
|
coverage: none
|
||||||
- if: ${{ matrix.php-version == '8.1' }}
|
- if: ${{ matrix.php-version == '8.1' }}
|
||||||
run: composer install --no-interaction --prefer-dist --ignore-platform-req=php
|
run: composer install --no-interaction --prefer-dist --ignore-platform-req=php
|
||||||
|
@ -144,7 +144,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php-version }}
|
php-version: ${{ matrix.php-version }}
|
||||||
tools: composer
|
tools: composer
|
||||||
extensions: swoole-4.7.1
|
extensions: openswoole-4.8.1
|
||||||
coverage: none
|
coverage: none
|
||||||
- if: ${{ matrix.php-version == '8.1' }}
|
- if: ${{ matrix.php-version == '8.1' }}
|
||||||
run: composer install --no-interaction --prefer-dist --ignore-platform-req=php
|
run: composer install --no-interaction --prefer-dist --ignore-platform-req=php
|
||||||
|
@ -168,7 +168,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php-version }}
|
php-version: ${{ matrix.php-version }}
|
||||||
tools: composer
|
tools: composer
|
||||||
extensions: swoole-4.7.1
|
extensions: openswoole-4.8.1
|
||||||
coverage: none
|
coverage: none
|
||||||
- if: ${{ matrix.php-version == '8.1' }}
|
- if: ${{ matrix.php-version == '8.1' }}
|
||||||
run: composer install --no-interaction --prefer-dist --ignore-platform-req=php
|
run: composer install --no-interaction --prefer-dist --ignore-platform-req=php
|
||||||
|
@ -196,7 +196,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php-version }}
|
php-version: ${{ matrix.php-version }}
|
||||||
tools: composer
|
tools: composer
|
||||||
extensions: swoole-4.7.1, pdo_sqlsrv-5.10.0beta2
|
extensions: openswoole-4.8.1, pdo_sqlsrv-5.10.0beta2
|
||||||
coverage: none
|
coverage: none
|
||||||
- if: ${{ matrix.php-version == '8.1' }}
|
- if: ${{ matrix.php-version == '8.1' }}
|
||||||
run: composer install --no-interaction --prefer-dist --ignore-platform-req=php
|
run: composer install --no-interaction --prefer-dist --ignore-platform-req=php
|
||||||
|
@ -222,7 +222,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php-version }}
|
php-version: ${{ matrix.php-version }}
|
||||||
tools: composer
|
tools: composer
|
||||||
extensions: swoole-4.7.1
|
extensions: openswoole-4.8.1
|
||||||
coverage: pcov
|
coverage: pcov
|
||||||
ini-values: pcov.directory=module
|
ini-values: pcov.directory=module
|
||||||
- if: ${{ matrix.php-version == '8.1' }}
|
- if: ${{ matrix.php-version == '8.1' }}
|
||||||
|
@ -257,7 +257,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php-version }}
|
php-version: ${{ matrix.php-version }}
|
||||||
tools: composer
|
tools: composer
|
||||||
extensions: swoole-4.7.1
|
extensions: openswoole-4.8.1
|
||||||
coverage: pcov
|
coverage: pcov
|
||||||
ini-values: pcov.directory=module
|
ini-values: pcov.directory=module
|
||||||
- if: ${{ matrix.php-version == '8.1' }}
|
- if: ${{ matrix.php-version == '8.1' }}
|
||||||
|
|
2
.github/workflows/publish-release.yml
vendored
2
.github/workflows/publish-release.yml
vendored
|
@ -20,7 +20,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php-version }}
|
php-version: ${{ matrix.php-version }}
|
||||||
tools: composer
|
tools: composer
|
||||||
extensions: swoole-4.6.7
|
extensions: openswoole-4.8.1
|
||||||
- if: ${{ matrix.swoole == 'yes' }}
|
- if: ${{ matrix.swoole == 'yes' }}
|
||||||
run: ./build.sh ${GITHUB_REF#refs/tags/v}
|
run: ./build.sh ${GITHUB_REF#refs/tags/v}
|
||||||
- if: ${{ matrix.swoole == 'no' }}
|
- if: ${{ matrix.swoole == 'no' }}
|
||||||
|
|
|
@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
### Added
|
### Added
|
||||||
* *Nothing*
|
* [#1204](https://github.com/shlinkio/shlink/issues/1204) Added support for `openswoole` and migrated official docker image to `openswoole`.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
* [#1218](https://github.com/shlinkio/shlink/issues/1218) Updated to symfony/mercure 0.6.
|
* [#1218](https://github.com/shlinkio/shlink/issues/1218) Updated to symfony/mercure 0.6.
|
||||||
|
|
10
Dockerfile
10
Dockerfile
|
@ -2,7 +2,7 @@ FROM php:8.0.9-alpine3.14 as base
|
||||||
|
|
||||||
ARG SHLINK_VERSION=latest
|
ARG SHLINK_VERSION=latest
|
||||||
ENV SHLINK_VERSION ${SHLINK_VERSION}
|
ENV SHLINK_VERSION ${SHLINK_VERSION}
|
||||||
ENV SWOOLE_VERSION 4.7.1
|
ENV OPENSWOOLE_VERSION 4.8.1
|
||||||
ENV PDO_SQLSRV_VERSION 5.10.0beta2
|
ENV PDO_SQLSRV_VERSION 5.10.0beta2
|
||||||
ENV MS_ODBC_SQL_VERSION 17.5.2.2
|
ENV MS_ODBC_SQL_VERSION 17.5.2.2
|
||||||
ENV LC_ALL "C"
|
ENV LC_ALL "C"
|
||||||
|
@ -40,10 +40,10 @@ RUN if [ $(uname -m) == "x86_64" ]; then \
|
||||||
rm msodbcsql17_${MS_ODBC_SQL_VERSION}-1_amd64.apk ; \
|
rm msodbcsql17_${MS_ODBC_SQL_VERSION}-1_amd64.apk ; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install swoole
|
# Install openswoole
|
||||||
RUN apk add --no-cache --virtual .phpize-deps ${PHPIZE_DEPS} && \
|
RUN apk add --no-cache --virtual .phpize-deps ${PHPIZE_DEPS} && \
|
||||||
pecl install swoole-${SWOOLE_VERSION} && \
|
pecl install openswoole-${OPENSWOOLE_VERSION} && \
|
||||||
docker-php-ext-enable swoole && \
|
docker-php-ext-enable openswoole && \
|
||||||
apk del .phpize-deps
|
apk del .phpize-deps
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ LABEL maintainer="Alejandro Celaya <alejandro@alejandrocelaya.com>"
|
||||||
COPY --from=builder /etc/shlink .
|
COPY --from=builder /etc/shlink .
|
||||||
RUN ln -s /etc/shlink/bin/cli /usr/local/bin/shlink
|
RUN ln -s /etc/shlink/bin/cli /usr/local/bin/shlink
|
||||||
|
|
||||||
# Expose default swoole port
|
# Expose default openswoole port
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
# Copy config specific for the image
|
# Copy config specific for the image
|
||||||
|
|
|
@ -36,7 +36,7 @@ First, make sure the host where you are going to run shlink fulfills these requi
|
||||||
|
|
||||||
* PHP 8.0
|
* PHP 8.0
|
||||||
* The next PHP extensions: json, curl, pdo, intl, gd and gmp.
|
* The next PHP extensions: json, curl, pdo, intl, gd and gmp.
|
||||||
* apcu extension is recommended if you don't plan to use swoole.
|
* apcu extension is recommended if you don't plan to use swoole or openswoole.
|
||||||
* xml extension is required if you want to generate QR codes in svg format.
|
* xml extension is required if you want to generate QR codes in svg format.
|
||||||
* MySQL, MariaDB, PostgreSQL, Microsoft SQL Server or SQLite.
|
* MySQL, MariaDB, PostgreSQL, Microsoft SQL Server or SQLite.
|
||||||
* The web server of your choice with PHP integration (Apache or Nginx recommended).
|
* The web server of your choice with PHP integration (Apache or Nginx recommended).
|
||||||
|
@ -49,7 +49,7 @@ In order to run Shlink, you will need a built version of the project. There are
|
||||||
|
|
||||||
The easiest way to install shlink is by using one of the pre-bundled distributable packages.
|
The easiest way to install shlink is by using one of the pre-bundled distributable packages.
|
||||||
|
|
||||||
Go to the [latest version](https://github.com/shlinkio/shlink/releases/latest) and download the `shlink*_dist.zip` file that suits your needs. You will find one for every supported PHP version and with/without swoole integration.
|
Go to the [latest version](https://github.com/shlinkio/shlink/releases/latest) and download the `shlink*_dist.zip` file that suits your needs. You will find one for every supported PHP version and with/without swoole/openswoole integration.
|
||||||
|
|
||||||
Finally, decompress the file in the location of your choice.
|
Finally, decompress the file in the location of your choice.
|
||||||
|
|
||||||
|
|
|
@ -47,11 +47,11 @@
|
||||||
"pugx/shortid-php": "^0.7",
|
"pugx/shortid-php": "^0.7",
|
||||||
"ramsey/uuid": "^3.9",
|
"ramsey/uuid": "^3.9",
|
||||||
"rlanvin/php-ip": "3.0.0-rc2",
|
"rlanvin/php-ip": "3.0.0-rc2",
|
||||||
"shlinkio/shlink-common": "^4.1",
|
"shlinkio/shlink-common": "dev-main#2f3ac05 as 4.2",
|
||||||
"shlinkio/shlink-config": "^1.3.1",
|
"shlinkio/shlink-config": "^1.4",
|
||||||
"shlinkio/shlink-event-dispatcher": "^2.2",
|
"shlinkio/shlink-event-dispatcher": "dev-main#3925299 as 2.3",
|
||||||
"shlinkio/shlink-importer": "^2.4",
|
"shlinkio/shlink-importer": "^2.4",
|
||||||
"shlinkio/shlink-installer": "^6.2.1",
|
"shlinkio/shlink-installer": "dev-develop#e3f2e64 as 6.3",
|
||||||
"shlinkio/shlink-ip-geolocation": "^2.2",
|
"shlinkio/shlink-ip-geolocation": "^2.2",
|
||||||
"symfony/console": "^5.4",
|
"symfony/console": "^5.4",
|
||||||
"symfony/filesystem": "^5.4",
|
"symfony/filesystem": "^5.4",
|
||||||
|
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
use Monolog\Handler\StreamHandler;
|
use Monolog\Handler\StreamHandler;
|
||||||
use Monolog\Logger;
|
use Monolog\Logger;
|
||||||
|
|
||||||
$isSwoole = extension_loaded('swoole');
|
$isSwoole = extension_loaded('openswoole');
|
||||||
|
|
||||||
// For swoole, send logs to standard output
|
// For swoole, send logs to standard output
|
||||||
$handler = $isSwoole
|
$handler = $isSwoole
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
$isSwoole = extension_loaded('swoole');
|
$isSwoole = extension_loaded('openswoole');
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ MAINTAINER Alejandro Celaya <alejandro@alejandrocelaya.com>
|
||||||
|
|
||||||
ENV APCU_VERSION 5.1.20
|
ENV APCU_VERSION 5.1.20
|
||||||
ENV INOTIFY_VERSION 3.0.0
|
ENV INOTIFY_VERSION 3.0.0
|
||||||
ENV SWOOLE_VERSION 4.7.1
|
ENV OPENSWOOLE_VERSION 4.8.1
|
||||||
ENV PDO_SQLSRV_VERSION 5.10.0beta2
|
ENV PDO_SQLSRV_VERSION 5.10.0beta2
|
||||||
ENV MS_ODBC_SQL_VERSION 17.5.2.2
|
ENV MS_ODBC_SQL_VERSION 17.5.2.2
|
||||||
|
|
||||||
|
@ -54,12 +54,12 @@ RUN mkdir -p /usr/src/php/ext/inotify \
|
||||||
&& docker-php-ext-install inotify \
|
&& docker-php-ext-install inotify \
|
||||||
&& rm /tmp/inotify.tar.gz
|
&& rm /tmp/inotify.tar.gz
|
||||||
|
|
||||||
# Install swoole, pcov and mssql driver
|
# Install openswoole, pcov and mssql driver
|
||||||
RUN wget https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_${MS_ODBC_SQL_VERSION}-1_amd64.apk && \
|
RUN wget https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_${MS_ODBC_SQL_VERSION}-1_amd64.apk && \
|
||||||
apk add --allow-untrusted msodbcsql17_${MS_ODBC_SQL_VERSION}-1_amd64.apk && \
|
apk add --allow-untrusted msodbcsql17_${MS_ODBC_SQL_VERSION}-1_amd64.apk && \
|
||||||
apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS unixodbc-dev && \
|
apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS unixodbc-dev && \
|
||||||
pecl install swoole-${SWOOLE_VERSION} pdo_sqlsrv-${PDO_SQLSRV_VERSION} pcov && \
|
pecl install openswoole-${OPENSWOOLE_VERSION} pdo_sqlsrv-${PDO_SQLSRV_VERSION} pcov && \
|
||||||
docker-php-ext-enable swoole pdo_sqlsrv pcov && \
|
docker-php-ext-enable openswoole pdo_sqlsrv pcov && \
|
||||||
apk del .phpize-deps && \
|
apk del .phpize-deps && \
|
||||||
rm msodbcsql17_${MS_ODBC_SQL_VERSION}-1_amd64.apk
|
rm msodbcsql17_${MS_ODBC_SQL_VERSION}-1_amd64.apk
|
||||||
|
|
||||||
|
@ -72,12 +72,12 @@ RUN chmod 777 /home
|
||||||
VOLUME /home/shlink
|
VOLUME /home/shlink
|
||||||
WORKDIR /home/shlink
|
WORKDIR /home/shlink
|
||||||
|
|
||||||
# Expose swoole port
|
# Expose openswoole port
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
CMD \
|
CMD \
|
||||||
# Install dependencies if the vendor dir does not exist
|
# Install dependencies if the vendor dir does not exist
|
||||||
if [[ ! -d "./vendor" ]]; then /usr/local/bin/composer install ; fi && \
|
if [[ ! -d "./vendor" ]]; then /usr/local/bin/composer install ; fi && \
|
||||||
# When restarting the container, swoole might think it is already in execution
|
# When restarting the container, openswoole might think it is already in execution
|
||||||
# This forces the app to be started every second until the exit code is 0
|
# This forces the app to be started every second until the exit code is 0
|
||||||
until php ./vendor/bin/laminas mezzio:swoole:start; do sleep 1 ; done
|
until php ./vendor/bin/laminas mezzio:swoole:start; do sleep 1 ; done
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
This image provides an easy way to set up [shlink](https://shlink.io) on a container-based runtime.
|
This image provides an easy way to set up [shlink](https://shlink.io) on a container-based runtime.
|
||||||
|
|
||||||
It exposes a shlink instance served with [swoole](https://www.swoole.co.uk/), which can be linked to external databases to persist data.
|
It exposes a shlink instance served with [openswoole](https://www.swoole.co.uk/), which can be linked to external databases to persist data.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,6 @@ if [ $ENABLE_PERIODIC_VISIT_LOCATE ]; then
|
||||||
/usr/sbin/crond &
|
/usr/sbin/crond &
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# When restarting the container, swoole might think it is already in execution
|
# When restarting the container, openswoole might think it is already in execution
|
||||||
# This forces the app to be started every second until the exit code is 0
|
# This forces the app to be started every second until the exit code is 0
|
||||||
until php vendor/bin/laminas mezzio:swoole:start; do sleep 1 ; done
|
until php vendor/bin/laminas mezzio:swoole:start; do sleep 1 ; done
|
||||||
|
|
Loading…
Add table
Reference in a new issue