mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-26 23:18:37 +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:
|
||||
php-version: ${{ matrix.php-version }}
|
||||
tools: composer
|
||||
extensions: swoole-4.7.1
|
||||
extensions: openswoole-4.8.1
|
||||
coverage: none
|
||||
- run: composer install --no-interaction --prefer-dist
|
||||
- run: composer cs
|
||||
|
@ -39,7 +39,7 @@ jobs:
|
|||
with:
|
||||
php-version: ${{ matrix.php-version }}
|
||||
tools: composer
|
||||
extensions: swoole-4.7.1
|
||||
extensions: openswoole-4.8.1
|
||||
coverage: none
|
||||
- run: composer install --no-interaction --prefer-dist
|
||||
- run: composer stan
|
||||
|
@ -58,7 +58,7 @@ jobs:
|
|||
with:
|
||||
php-version: ${{ matrix.php-version }}
|
||||
tools: composer
|
||||
extensions: swoole-4.7.1
|
||||
extensions: openswoole-4.8.1
|
||||
coverage: pcov
|
||||
ini-values: pcov.directory=module
|
||||
- if: ${{ matrix.php-version == '8.1' }}
|
||||
|
@ -88,7 +88,7 @@ jobs:
|
|||
with:
|
||||
php-version: ${{ matrix.php-version }}
|
||||
tools: composer
|
||||
extensions: swoole-4.7.1
|
||||
extensions: openswoole-4.8.1
|
||||
coverage: pcov
|
||||
ini-values: pcov.directory=module
|
||||
- if: ${{ matrix.php-version == '8.1' }}
|
||||
|
@ -120,7 +120,7 @@ jobs:
|
|||
with:
|
||||
php-version: ${{ matrix.php-version }}
|
||||
tools: composer
|
||||
extensions: swoole-4.7.1
|
||||
extensions: openswoole-4.8.1
|
||||
coverage: none
|
||||
- if: ${{ matrix.php-version == '8.1' }}
|
||||
run: composer install --no-interaction --prefer-dist --ignore-platform-req=php
|
||||
|
@ -144,7 +144,7 @@ jobs:
|
|||
with:
|
||||
php-version: ${{ matrix.php-version }}
|
||||
tools: composer
|
||||
extensions: swoole-4.7.1
|
||||
extensions: openswoole-4.8.1
|
||||
coverage: none
|
||||
- if: ${{ matrix.php-version == '8.1' }}
|
||||
run: composer install --no-interaction --prefer-dist --ignore-platform-req=php
|
||||
|
@ -168,7 +168,7 @@ jobs:
|
|||
with:
|
||||
php-version: ${{ matrix.php-version }}
|
||||
tools: composer
|
||||
extensions: swoole-4.7.1
|
||||
extensions: openswoole-4.8.1
|
||||
coverage: none
|
||||
- if: ${{ matrix.php-version == '8.1' }}
|
||||
run: composer install --no-interaction --prefer-dist --ignore-platform-req=php
|
||||
|
@ -196,7 +196,7 @@ jobs:
|
|||
with:
|
||||
php-version: ${{ matrix.php-version }}
|
||||
tools: composer
|
||||
extensions: swoole-4.7.1, pdo_sqlsrv-5.10.0beta2
|
||||
extensions: openswoole-4.8.1, pdo_sqlsrv-5.10.0beta2
|
||||
coverage: none
|
||||
- if: ${{ matrix.php-version == '8.1' }}
|
||||
run: composer install --no-interaction --prefer-dist --ignore-platform-req=php
|
||||
|
@ -222,7 +222,7 @@ jobs:
|
|||
with:
|
||||
php-version: ${{ matrix.php-version }}
|
||||
tools: composer
|
||||
extensions: swoole-4.7.1
|
||||
extensions: openswoole-4.8.1
|
||||
coverage: pcov
|
||||
ini-values: pcov.directory=module
|
||||
- if: ${{ matrix.php-version == '8.1' }}
|
||||
|
@ -257,7 +257,7 @@ jobs:
|
|||
with:
|
||||
php-version: ${{ matrix.php-version }}
|
||||
tools: composer
|
||||
extensions: swoole-4.7.1
|
||||
extensions: openswoole-4.8.1
|
||||
coverage: pcov
|
||||
ini-values: pcov.directory=module
|
||||
- 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:
|
||||
php-version: ${{ matrix.php-version }}
|
||||
tools: composer
|
||||
extensions: swoole-4.6.7
|
||||
extensions: openswoole-4.8.1
|
||||
- if: ${{ matrix.swoole == 'yes' }}
|
||||
run: ./build.sh ${GITHUB_REF#refs/tags/v}
|
||||
- if: ${{ matrix.swoole == 'no' }}
|
||||
|
|
|
@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this
|
|||
|
||||
## [Unreleased]
|
||||
### Added
|
||||
* *Nothing*
|
||||
* [#1204](https://github.com/shlinkio/shlink/issues/1204) Added support for `openswoole` and migrated official docker image to `openswoole`.
|
||||
|
||||
### Changed
|
||||
* [#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
|
||||
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 MS_ODBC_SQL_VERSION 17.5.2.2
|
||||
ENV LC_ALL "C"
|
||||
|
@ -40,10 +40,10 @@ RUN if [ $(uname -m) == "x86_64" ]; then \
|
|||
rm msodbcsql17_${MS_ODBC_SQL_VERSION}-1_amd64.apk ; \
|
||||
fi
|
||||
|
||||
# Install swoole
|
||||
# Install openswoole
|
||||
RUN apk add --no-cache --virtual .phpize-deps ${PHPIZE_DEPS} && \
|
||||
pecl install swoole-${SWOOLE_VERSION} && \
|
||||
docker-php-ext-enable swoole && \
|
||||
pecl install openswoole-${OPENSWOOLE_VERSION} && \
|
||||
docker-php-ext-enable openswoole && \
|
||||
apk del .phpize-deps
|
||||
|
||||
|
||||
|
@ -65,7 +65,7 @@ LABEL maintainer="Alejandro Celaya <alejandro@alejandrocelaya.com>"
|
|||
COPY --from=builder /etc/shlink .
|
||||
RUN ln -s /etc/shlink/bin/cli /usr/local/bin/shlink
|
||||
|
||||
# Expose default swoole port
|
||||
# Expose default openswoole port
|
||||
EXPOSE 8080
|
||||
|
||||
# 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
|
||||
* 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.
|
||||
* MySQL, MariaDB, PostgreSQL, Microsoft SQL Server or SQLite.
|
||||
* 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.
|
||||
|
||||
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.
|
||||
|
||||
|
|
|
@ -47,11 +47,11 @@
|
|||
"pugx/shortid-php": "^0.7",
|
||||
"ramsey/uuid": "^3.9",
|
||||
"rlanvin/php-ip": "3.0.0-rc2",
|
||||
"shlinkio/shlink-common": "^4.1",
|
||||
"shlinkio/shlink-config": "^1.3.1",
|
||||
"shlinkio/shlink-event-dispatcher": "^2.2",
|
||||
"shlinkio/shlink-common": "dev-main#2f3ac05 as 4.2",
|
||||
"shlinkio/shlink-config": "^1.4",
|
||||
"shlinkio/shlink-event-dispatcher": "dev-main#3925299 as 2.3",
|
||||
"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",
|
||||
"symfony/console": "^5.4",
|
||||
"symfony/filesystem": "^5.4",
|
||||
|
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
|||
use Monolog\Handler\StreamHandler;
|
||||
use Monolog\Logger;
|
||||
|
||||
$isSwoole = extension_loaded('swoole');
|
||||
$isSwoole = extension_loaded('openswoole');
|
||||
|
||||
// For swoole, send logs to standard output
|
||||
$handler = $isSwoole
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
$isSwoole = extension_loaded('swoole');
|
||||
$isSwoole = extension_loaded('openswoole');
|
||||
|
||||
return [
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ MAINTAINER Alejandro Celaya <alejandro@alejandrocelaya.com>
|
|||
|
||||
ENV APCU_VERSION 5.1.20
|
||||
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 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 \
|
||||
&& 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 && \
|
||||
apk add --allow-untrusted msodbcsql17_${MS_ODBC_SQL_VERSION}-1_amd64.apk && \
|
||||
apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS unixodbc-dev && \
|
||||
pecl install swoole-${SWOOLE_VERSION} pdo_sqlsrv-${PDO_SQLSRV_VERSION} pcov && \
|
||||
docker-php-ext-enable swoole pdo_sqlsrv pcov && \
|
||||
pecl install openswoole-${OPENSWOOLE_VERSION} pdo_sqlsrv-${PDO_SQLSRV_VERSION} pcov && \
|
||||
docker-php-ext-enable openswoole pdo_sqlsrv pcov && \
|
||||
apk del .phpize-deps && \
|
||||
rm msodbcsql17_${MS_ODBC_SQL_VERSION}-1_amd64.apk
|
||||
|
||||
|
@ -72,12 +72,12 @@ RUN chmod 777 /home
|
|||
VOLUME /home/shlink
|
||||
WORKDIR /home/shlink
|
||||
|
||||
# Expose swoole port
|
||||
# Expose openswoole port
|
||||
EXPOSE 8080
|
||||
|
||||
CMD \
|
||||
# Install dependencies if the vendor dir does not exist
|
||||
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
|
||||
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.
|
||||
|
||||
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
|
||||
|
||||
|
|
|
@ -30,6 +30,6 @@ if [ $ENABLE_PERIODIC_VISIT_LOCATE ]; then
|
|||
/usr/sbin/crond &
|
||||
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
|
||||
until php vendor/bin/laminas mezzio:swoole:start; do sleep 1 ; done
|
||||
|
|
Loading…
Reference in a new issue