Skip to content

Commit

Permalink
Merge branch 'refactor'
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcbrl committed Oct 1, 2024
2 parents 1f4ad5b + 1adc86f commit 6ff9675
Show file tree
Hide file tree
Showing 15 changed files with 2,329 additions and 967 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ vendor

# project
.env
.devops/data
30 changes: 16 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
FROM php:8.1-cli
FROM php:8.3-fpm

RUN apt-get update && apt-get install -y curl git zip
WORKDIR /api

RUN apt-get update && apt-get install -y curl bash git zip
RUN apt-get update && apt-get install -y libbrotli-dev ${PHPIZE_DEPS}
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN pecl install swoole && docker-php-ext-enable swoole
RUN pecl install redis swoole && docker-php-ext-enable redis swoole
RUN docker-php-ext-install pdo pdo_mysql

RUN pecl install xdebug-3.1.6 && docker-php-ext-enable xdebug
RUN pecl install xdebug-3.3.2 && docker-php-ext-enable xdebug
ENV XDEBUG_CLIENT_HOST=host.docker.internal
ENV XDEBUG_PORT=9001
ENV XDEBUG_IDE_KEY="FIDELIFY"
ENV XDEBUG_START_WITH_REQUEST=yes
ENV XDEBUG_START=yes
RUN echo "xdebug.mode=debug,profile,coverage,develop" >> "${PHP_INI_DIR}/conf.d/90-xdebug.ini" \
&& echo "xdebug.discover_client_host=0" >> "${PHP_INI_DIR}/conf.d/90-xdebug.ini" \
&& echo "xdebug.client_host=${XDEBUG_CLIENT_HOST}" >> "${PHP_INI_DIR}/conf.d/90-xdebug.ini" \
&& echo "xdebug.idekey=${XDEBUG_IDE_KEY}" >> "${PHP_INI_DIR}/conf.d/90-xdebug.ini" \
&& echo "xdebug.client_port=${XDEBUG_PORT}" >> "${PHP_INI_DIR}/conf.d/90-xdebug.ini" \
&& echo "xdebug.start_with_request=${XDEBUG_START_WITH_REQUEST}" >> "${PHP_INI_DIR}/conf.d/90-xdebug.ini"
&& echo "xdebug.discover_client_host=0" >> "${PHP_INI_DIR}/conf.d/90-xdebug.ini" \
&& echo "xdebug.client_host=${XDEBUG_CLIENT_HOST}" >> "${PHP_INI_DIR}/conf.d/90-xdebug.ini" \
&& echo "xdebug.client_port=${XDEBUG_PORT}" >> "${PHP_INI_DIR}/conf.d/90-xdebug.ini" \
&& echo "xdebug.start_with_request=${XDEBUG_START}" >> "${PHP_INI_DIR}/conf.d/90-xdebug.ini"

COPY . /api

COPY . /usr/src/swoole-server
WORKDIR /usr/src/swoole-server
RUN composer install

RUN cd /usr/src/swoole-server && composer install
# ENTRYPOINT [ "sh", "-c", "php public/index.php" ]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

> Docker required: [how to install](https://docs.docker.com/engine/install/ubuntu/).
1. `docker build -t swoole-server .`
2. `docker run -it -v $(pwd):/usr/src/swoole-server -p 8003:8003 --rm --name fidelify-api swoole-server php public/index.php`
1. `docker build -t fidelify/phpswoole .`
2. `docker run -it -v $(pwd):/api -p 8003:8003 --rm --name fidelify-api fidelify/phpswoole php public/index.php`
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"require": {
"league/route": "^5.1",
"league/container": "^4.2",
"laminas/laminas-diactoros": "^2.24",
"laminas/laminas-httphandlerrunner": "^2.4",
"laminas/laminas-diactoros": "^3.4",
"laminas/laminas-httphandlerrunner": "^2.10",
"ilexn/swoole-convert-psr7": "^0.6.1",
"nyholm/psr7": "^1.5",
"vlucas/phpdotenv": "^5.5"
"nyholm/psr7": "^1.8",
"illuminate/validation": "^11.25"
}
}
Loading

0 comments on commit 6ff9675

Please sign in to comment.