Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISSUE-276 RoadRunner setup #277

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion .docker/nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,32 @@ server {
ssl_certificate /etc/nginx/certs/draw.com.crt;
ssl_certificate_key /etc/nginx/certs/draw.com.key;

# beta.breethe.com is in case we want to test something like apple sign in
server_name dev.draw.com;
root /home/wwwroot/public;

location / {
proxy_pass http://php:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port 443;
}

error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
}

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;

ssl_certificate /etc/nginx/certs/draw.com.crt;
ssl_certificate_key /etc/nginx/certs/draw.com.key;

server_name phpfpm-dev.draw.com;
root /home/wwwroot/public;

location / {
try_files $uri @rewriteapp;
}
Expand Down
4 changes: 4 additions & 0 deletions .docker/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends libicu-dev
RUN docker-php-ext-install intl

# ROADRUNNER
RUN docker-php-ext-install sockets

#localisation file
RUN rm -rf /var/lib/apt/lists/*
RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
Expand Down Expand Up @@ -80,4 +83,5 @@ USER dev

WORKDIR /home/wwwroot/

EXPOSE 8080
EXPOSE 9000
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ composer-normalize
###> phpstan/phpstan ###
phpstan.neon
###< phpstan/phpstan ###

###> baldinof/roadrunner-bundle ###
#/bin/rr
###< baldinof/roadrunner-bundle ###
30 changes: 30 additions & 0 deletions .rr.dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: "3"

server:
command: "php public/index.php"
env:
- APP_RUNTIME: Baldinof\RoadRunnerBundle\Runtime\Runtime

http:
address: 0.0.0.0:8080
pool:
debug: true
num_workers: 8 # Adjust based on your system's CPU cores
max_jobs: 200 # Maximum number of jobs a worker can handle before being recycled
middleware: [ "static", "gzip" ]
uploads:
forbid: [ ".php", ".exe", ".bat" ]
static:
dir: "public"
forbid: [ ".php", ".htaccess" ]

logs:
mode: development
channels:
http:
level: debug # Log all http requests, set to info to disable
server:
level: info # Everything written to worker stderr is logged
mode: raw
metrics:
level: debug
39 changes: 39 additions & 0 deletions .rr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: "3"

server:
command: "php public/index.php"
env:
- APP_RUNTIME: Baldinof\RoadRunnerBundle\Runtime\Runtime

http:
address: 0.0.0.0:8080
pool:
debug: false
num_workers: 8 # Adjust based on your system's CPU cores
max_jobs: 4000 # Maximum number of jobs a worker can handle before being recycled
middleware: [ "static", "gzip" ]
uploads:
forbid: [ ".php", ".exe", ".bat" ]
static:
dir: "public"
forbid: [ ".php", ".htaccess" ]

logs:
mode: production
channels:
http:
level: debug # Log all http requests, set to info to disable
server:
level: info # Everything written to worker stderr is logged
mode: raw
metrics:
level: error

# Uncomment to use metrics integration
# rpc:
# listen: tcp://127.0.0.1:6001

# Uncomment to use metrics integration
# metrics:
# # prometheus client address (path /metrics added automatically)
# address: "0.0.0.0:9180"
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
DOMAIN := draw.com

# Add dev.draw.com and phpfpm-dev.draw.com to /etc/hosts
## dev.draw.com use Road Runner

include make/shared.mk

tester-dump-assert-methods:
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ draw

Draw is meant to be a list of component that can be use independently and also providing a bundle integration for Symfony.

Draw is a acronym in french for Développement Rapide d'Application Web, meaning Rapid Web Application Development.
Draw is an acronym in French for Développement Rapide d'Application Web, meaning Rapid Web Application Development.

We do follow [Semantic Versioning](https://semver.org/) and we want to point out:

Expand All @@ -12,5 +12,11 @@ We do follow [Semantic Versioning](https://semver.org/) and we want to point out
Most of the library is currently use in a production context but some major change may occur in the development of a stable
version.

## Contributing

Read the [CONTRIBUTING.md](./CONTRIBUTING.md) file for installation process and how to contribute.

```bash

## Component
- [Tester](./src/Component/Tester)
Binary file added bin/rr
Binary file not shown.
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"ext-json": "*",
"ext-mongodb": "*",
"ext-simplexml": "*",
"ext-sockets": "*",
"ext-zip": "*",
"aws/aws-sdk-php": "^3.171",
"doctrine/common": "^3.1",
Expand Down Expand Up @@ -63,7 +64,8 @@
"doctrine/mongodb-odm-bundle": "*",
"fidry/cpu-core-counter": "^1.1",
"knplabs/doctrine-behaviors": "*",
"symfony/notifier": "^6.4.0"
"symfony/notifier": "^6.4.0",
"baldinof/roadrunner-bundle": "^3.1"
},
"require-dev": {
"ext-pcntl": "*",
Expand Down Expand Up @@ -122,7 +124,8 @@
"scheb/2fa-email": "^6.0",
"colinodell/psr-testlogger": "^1.1",
"cweagans/composer-patches": "^1.7",
"symfony/maker-bundle": "^1.58"
"symfony/maker-bundle": "^1.58",
"spiral/roadrunner-cli": "^2.6"
},
"replace": {
"draw/application": "self.version",
Expand Down
Loading
Loading