From d381df5c61c1e03b1e3e6481a0add552cfc218d8 Mon Sep 17 00:00:00 2001 From: mmuniraju4444 <11813475+mmuniraju4444@users.noreply.github.com> Date: Thu, 30 Apr 2020 08:38:58 +0530 Subject: [PATCH] Add Browserless services --- Browserless/.env.example | 4 ++++ Browserless/.gitignore | 1 + Browserless/Dockerfile | 2 ++ Nginx/conf/app.conf | 36 ++++++++++++++++++++++++++++++-- Php-fpm/Dockerfile | 1 + Supervisor/Dockerfile | 1 + Supervisor/config/scheduler.conf | 17 +++++++++++---- Supervisor/config/workers.conf | 25 ++++++++++++++++++---- Workspace/Dockerfile | 3 ++- 9 files changed, 79 insertions(+), 11 deletions(-) create mode 100644 Browserless/.env.example create mode 100644 Browserless/.gitignore create mode 100644 Browserless/Dockerfile diff --git a/Browserless/.env.example b/Browserless/.env.example new file mode 100644 index 0000000..36c950d --- /dev/null +++ b/Browserless/.env.example @@ -0,0 +1,4 @@ +TOKEN=2cbc5771-38f2-4dcf-8774-50ad51a971b8 +ENABLE_API_GET=true +WORKSPACE_DELETE_EXPIRED=true +WORKSPACE_EXPIRE_DAYS=1 \ No newline at end of file diff --git a/Browserless/.gitignore b/Browserless/.gitignore new file mode 100644 index 0000000..4cb512e --- /dev/null +++ b/Browserless/.gitignore @@ -0,0 +1 @@ +/.env \ No newline at end of file diff --git a/Browserless/Dockerfile b/Browserless/Dockerfile new file mode 100644 index 0000000..737d30e --- /dev/null +++ b/Browserless/Dockerfile @@ -0,0 +1,2 @@ +ARG CONTAINER_VERSION=${CONTAINER_VERSION} +FROM browserless/chrome:${CONTAINER_VERSION} \ No newline at end of file diff --git a/Nginx/conf/app.conf b/Nginx/conf/app.conf index 748d44f..3d87b2d 100644 --- a/Nginx/conf/app.conf +++ b/Nginx/conf/app.conf @@ -19,7 +19,7 @@ server { server { listen 80; - server_name database.blog.local; + server_name database.local; location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-NginX-Proxy true; @@ -36,10 +36,42 @@ server { server { listen 80; - server_name supervisor.blog.local; + server_name supervisor.local; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; proxy_pass http://supervisor:9001; } } + +server { + listen 80; + server_name rent.local; + root /var/www/html/rent/public; + index index.php; + location / { + try_files $uri $uri/ /index.php?$query_string; + } + location ~ \.php$ { + try_files $uri =404; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass php-fpm:9000; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + } +} + +server { + listen 80; + server_name browserless.local; + location / { + proxy_pass http://browserless:3000; + 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; + } +} diff --git a/Php-fpm/Dockerfile b/Php-fpm/Dockerfile index eec0b4b..260c70a 100644 --- a/Php-fpm/Dockerfile +++ b/Php-fpm/Dockerfile @@ -2,6 +2,7 @@ ARG CONTAINER_VERSION=${CONTAINER_VERSION} FROM php:${CONTAINER_VERSION}-fpm-alpine RUN apk --update --no-cache add build-base \ + busybox-extras \ $PHPIZE_DEPS \ libjpeg-turbo-dev \ imagemagick-dev \ diff --git a/Supervisor/Dockerfile b/Supervisor/Dockerfile index 3ae2194..7266e33 100644 --- a/Supervisor/Dockerfile +++ b/Supervisor/Dockerfile @@ -2,6 +2,7 @@ ARG CONTAINER_VERSION=${CONTAINER_VERSION} FROM php:${CONTAINER_VERSION}-fpm-alpine RUN apk --update --no-cache add build-base \ + busybox-extras \ $PHPIZE_DEPS \ libjpeg-turbo-dev \ imagemagick-dev \ diff --git a/Supervisor/config/scheduler.conf b/Supervisor/config/scheduler.conf index 374b46b..aa8f0ab 100644 --- a/Supervisor/config/scheduler.conf +++ b/Supervisor/config/scheduler.conf @@ -1,7 +1,16 @@ -[program:application-name] +[program:schedule_blog] process_name=%(program_name)s_%(process_num)02d -command=php /var/www/html/blog/artisan schedule:run >> /dev/null 2>&1 +command=php /var/www/html/blog/artisan schedule:run autostart=true autorestart=true -numprocs=2 -redirect_stderr=true \ No newline at end of file +numprocs=1 +redirect_stderr=true +stopwaitsecs=3600 +[program:schedule_rent] +process_name=%(program_name)s_%(process_num)02d +command=php /var/www/html/rent/artisan schedule:run +autostart=true +autorestart=true +numprocs=1 +redirect_stderr=true +stopwaitsecs=3600 \ No newline at end of file diff --git a/Supervisor/config/workers.conf b/Supervisor/config/workers.conf index 3967023..99b4203 100644 --- a/Supervisor/config/workers.conf +++ b/Supervisor/config/workers.conf @@ -1,7 +1,24 @@ -[program:application-name] +[program:blog_default] process_name=%(program_name)s_%(process_num)02d -command=php /var/www/html/blog/artisan queue:work --sleep=3 --tries=3 --daemon +command=php /var/www/html/blog/artisan queue:work --queue=default --sleep=3 --tries=3 autostart=true autorestart=true -numprocs=8 -redirect_stderr=true \ No newline at end of file +numprocs=1 +redirect_stderr=true +stopwaitsecs=3600 +[program:rent_default] +process_name=%(program_name)s_%(process_num)02d +command=php /var/www/html/rent/artisan queue:work --queue=default --sleep=3 --tries=3 --daemon +autostart=true +autorestart=true +numprocs=1 +redirect_stderr=true +stopwaitsecs=3600 +[program:rent_emails] +process_name=%(program_name)s_%(process_num)02d +command=php /var/www/html/rent/artisan queue:work --queue=emails --sleep=3 --tries=3 --daemon +autostart=true +autorestart=true +numprocs=1 +redirect_stderr=true +stopwaitsecs=3600 \ No newline at end of file diff --git a/Workspace/Dockerfile b/Workspace/Dockerfile index 4e1ce4f..6c7b0d8 100644 --- a/Workspace/Dockerfile +++ b/Workspace/Dockerfile @@ -1,7 +1,8 @@ ARG CONTAINER_VERSION=${CONTAINER_VERSION} FROM php:${CONTAINER_VERSION}-fpm-alpine - +# busybox telnet RUN apk --update --no-cache add build-base \ + busybox-extras \ $PHPIZE_DEPS \ libjpeg-turbo-dev \ imagemagick-dev \