-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c155d9b
commit e55018a
Showing
7 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
- name: Deploy Laravel App Using Swoole Runtime | ||
hosts: all | ||
become: true | ||
remote_user: root | ||
roles: | ||
- config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
- name: Add PHP repository | ||
ansible.builtin.apt_repository: | ||
repo: "ppa:ondrej/php" | ||
state: present | ||
|
||
- name: Install PHP 8.2 & dependencies | ||
ansible.builtin.apt: | ||
name: | ||
- php8.2-mysql | ||
- php8.2-fpm | ||
- php8.2-mbstring | ||
- php8.2-xml | ||
- php8.2-bcmath | ||
- php8.2-curl | ||
- php8.2-cli | ||
- php8.2-common | ||
- php8.2-zip | ||
- php8.2-gd | ||
- php8.2-swoole | ||
- php8.2-soap | ||
state: present | ||
update_cache: true | ||
|
||
- name: Add sail config | ||
ansible.builtin.template: | ||
src: sail.j2 | ||
dest: /etc/php/8.2/cli/conf.d/99-sail.ini | ||
mode: preserve | ||
|
||
- name: Add supervisor config | ||
ansible.builtin.template: | ||
src: supervisor.j2 | ||
dest: /etc/supervisor/conf.d/laravel.conf | ||
mode: preserve | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
server { | ||
listen 80; | ||
server_name yourdomain.com; | ||
root /var/www/public; | ||
|
||
# CORS Config | ||
add_header 'Access-Control-Allow-Origin' '*' always; | ||
add_header 'Access-Control-Allow-Methods' '*' always; | ||
add_header 'Access-Control-Allow-Headers' '*' always; | ||
|
||
index index.html index.htm index.php; | ||
error_page 404 /index.php; | ||
location / { | ||
proxy_pass http://127.0.0.1:8089; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection 'upgrade'; | ||
proxy_set_header Host $host; | ||
proxy_cache_bypass $http_upgrade; | ||
} | ||
|
||
location ~ /\.ht { | ||
deny all; | ||
} | ||
|
||
error_log /var/log/nginx/athena_error.log; | ||
access_log /var/log/nginx/athena_access.log; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[PHP] | ||
post_max_size = 100M | ||
upload_max_filesize = 100M | ||
variables_order = EGPCS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
program:laravel-octane-worker] | ||
process_name=%(program_name)s_%(process_num)02d | ||
command=php -d variables_order=EGPCS /var/www/laravel/artisan octane:start --server=swoole --max-requests=1000 --workers=4 --task-workers=12 --port=8089 | ||
autostart=true | ||
autorestart=true | ||
user=www-data | ||
redirect_stderr=true | ||
stdout_logfile=/var/www/laravel/storage/logs/swoole_http.log | ||
stopwaitsecs=3600 | ||
environment=LARAVEL_SAIL="1" | ||
|
||
[supervisord] | ||
nodaemon=true | ||
user=root | ||
logfile=/var/log/supervisor/supervisord.log | ||
pidfile=/var/run/supervisord.pid |