From 00a96e621583d695aa114e543f3fbfde5f2a190e Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 3 Oct 2020 11:49:25 +0200 Subject: [PATCH] Allowed to change swoole port in docker image by using the PORT env var --- Dockerfile | 6 +++--- docker/config/shlink_in_docker.local.php | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1cd764e0..0c5411e2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM php:7.4.9-alpine3.12 as base -ARG SHLINK_VERSION=2.2.2 +ARG SHLINK_VERSION=2.3.0 ENV SHLINK_VERSION ${SHLINK_VERSION} ENV SWOOLE_VERSION 4.5.2 ENV LC_ALL "C" @@ -44,7 +44,7 @@ RUN apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS && \ # Install shlink FROM base as builder COPY . . -COPY --from=composer:1.10.1 /usr/bin/composer ./composer.phar +COPY --from=composer:1.10.13 /usr/bin/composer ./composer.phar RUN apk add --no-cache git && \ php composer.phar install --no-dev --optimize-autoloader --prefer-dist --no-progress --no-interaction && \ php composer.phar clear-cache && \ @@ -59,7 +59,7 @@ LABEL maintainer="Alejandro Celaya " COPY --from=builder /etc/shlink . RUN ln -s /etc/shlink/bin/cli /usr/local/bin/shlink -# Expose swoole port +# Expose default swoole port EXPOSE 8080 # Expose params config dir, since the user is expected to provide custom config from there diff --git a/docker/config/shlink_in_docker.local.php b/docker/config/shlink_in_docker.local.php index 8d3c55fa..8efee8a4 100644 --- a/docker/config/shlink_in_docker.local.php +++ b/docker/config/shlink_in_docker.local.php @@ -159,6 +159,7 @@ return [ 'mezzio-swoole' => [ 'swoole-http-server' => [ + 'port' => (int) env('PORT', 8080), 'options' => [ 'worker_num' => (int) env('WEB_WORKER_NUM', 16), 'task_worker_num' => (int) env('TASK_WORKER_NUM', 16),