Skip to content

Commit

Permalink
configure road runner to be use via nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
mpoiriert committed Jun 2, 2024
1 parent 8ee0907 commit a30bfa6
Show file tree
Hide file tree
Showing 12 changed files with 312 additions and 10 deletions.
26 changes: 24 additions & 2 deletions .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 All @@ -18,7 +40,7 @@ server {
}

location ~ ^/index\.php(/|$) {
fastcgi_pass php:9000;
fastcgi_pass php-fpm:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
Expand Down
1 change: 1 addition & 0 deletions .docker/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,5 @@ USER dev

WORKDIR /home/wwwroot/

EXPOSE 8080
EXPOSE 9000
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ phpstan.neon
###< phpstan/phpstan ###

###> baldinof/roadrunner-bundle ###
/bin/rr
#/bin/rr
###< baldinof/roadrunner-bundle ###
6 changes: 2 additions & 4 deletions .rr.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ server:

http:
address: 0.0.0.0:8080
ssl:
address: :443
cert: certs/draw.com.crt
key: certs/draw.com.key
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" ]
Expand Down
2 changes: 2 additions & 0 deletions .rr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ 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" ]
Expand Down
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.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,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

0 comments on commit a30bfa6

Please sign in to comment.