Code Monkey home page Code Monkey logo

laravel-roadrunner-in-docker's Introduction

coding


👷 Check out what I'm currently working on

🌱 My latest projects

🚀 Latest releases I've contributed to

🔨 Latest Pull Requests I published

⭐ Recent stars

💬 Feedback

If you use one of my projects, I'd love to hear from you! Don't be shy and let me know what you liked and what needs being improved. Got an issue? Open a ticket, I don't bite and will try my best to help!

laravel-roadrunner-in-docker's People

Contributors

dac514 avatar dependabot[bot] avatar nidheeshdas avatar renovate[bot] avatar tafhyseni avatar tarampampam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

laravel-roadrunner-in-docker's Issues

Web app startup error: WorkerAllocate: context deadline exceeded

Hello!

When I'm trying to get this app running, but keep getting the same error:

2022-06-24T15:41:19.068Z	DEBUG	rpc         	plugin was started	{"address": "tcp://127.0.0.1:6001", "list of the plugins with RPC methods:": ["resetter", "status", "informer"]}
[INFO] RoadRunner server started; version: 2.10.2, buildtime: 2022-05-26T12:30:20+0000
2022-06-24T15:41:29.093Z	ERROR	container/poller.go:16	vertex got an error	{"id": "http.Plugin", "error": "static_pool_allocate_workers: WorkerAllocate: context deadline exceeded"}
github.com/roadrunner-server/endure/pkg/container.(*Endure).poll.func1
	github.com/roadrunner-server/[email protected]/pkg/container/poller.go:16
error occurred: static_pool_allocate_workers: WorkerAllocate: context deadline exceeded, plugin: http.Plugin, stopping execution

How to reproduce (just follow the instructions):

  • checkout repo (no modifications to the source code)
  • make install
  • make init
  • make up

web container is up, but marked as unhealthy (project name here is check):

CONTAINER ID   IMAGE                COMMAND                  CREATED          STATUS                     PO
6f62fdd86f91   check_web            "rr serve -c .rr.loc…"   3 minutes ago    Up 3 minutes (unhealthy)   0.0.0.0:8080->8080/tcp, :::8080->8080/tcp, 0.0.0.0:8443->8443/tcp, :::8443->8443/tcp   check_web_1

The weird part here is that it happens from the cold container start via make up. Means that after make up I would do just a simple restart via:

  • docker stop 6f62fdd86f91
  • docker start 6f62fdd86f91
    when container starts without any issues.

Environment:

  • Docker version 20.10.8, build 3967b7d
  • MacOS 10.15.4

Maybe you have any idea what could be the reason?
Thanks!

Command `make init` failing

Hello!

After cloning this repository, I try to execute the command

$ make init

I expect to see something like this:

docker-compose run --rm --user "1000:1000" app php ./artisan migrate --force --seed
Creating network "laravel-roadrunner-in-docker_default" with the default driver
Creating volume "laravel-roadrunner-in-docker_pg-data" with default driver
Creating volume "laravel-roadrunner-in-docker_redis-data" with default driver
Creating volume "laravel-roadrunner-in-docker_tmp-data" with default driver
Pulling postgres (postgres:13.2-alpine)...
13.2-alpine: Pulling from library/postgres

But I see something else:

ERROR: The Compose file './docker-compose.yml' is invalid because:
services.app.depends_on contains an invalid type, it should be an array
services.cron.depends_on contains an invalid type, it should be an array
services.queue.depends_on contains an invalid type, it should be an array
services.web.depends_on contains an invalid type, it should be an array
Makefile:23: recipe for target 'init' failed

A part of docker-compose.yml

    depends_on:
      postgres:
        condition: service_healthy
      redis:
        condition: service_healthy

Error after command "make install"

just cloning the repository
$ git clone https://github.com/tarampampam/laravel-roadrunner-in-docker.git
then I enter the command
$ make install
I get the following error

In JsonFile.php line 178:
                                                                                
  file_put_contents(./composer.lock): Failed to open stream: Permission denied  
                                                                               
...

ERROR: 1
make: *** [Makefile:17: install] Ошибка 1

then I enter the command
$ composer i
and run again
$ make install
and i get this problem

In StreamHandler.php line 146:
                                                                                                                                                                                   
  The stream or file "/app/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied                                                  
  The exception occurred while attempting to log: The stream or file "/app/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied  
  The exception occurred while attempting to log: The /app/bootstrap/cache directory must be present and writable.                                                                 
  Context: {"exception":{}}                                                                                                                                                        
  Context: {"exception":{}}                                                                                                                                                        
                                

i am using Fedora 37

poor peformance vs nginx

#httpd-tools

ab -n 5000 -c 500 http://localhost:29999/

A lot of failed requests

Server Software:
Server Hostname:        localhost
Server Port:            29999

Document Path:          /
Document Length:        22043 bytes

Concurrency Level:      500
Time taken for tests:   109.117 seconds
Complete requests:      5000
Failed requests:        3168
   (Connect: 0, Receive: 0, Length: 3168, Exceptions: 0)
Non-2xx responses:      3168
Total transferred:      42810696 bytes
HTML transferred:       40382776 bytes
Requests per second:    45.82 [#/sec] (mean)
Time per request:       10911.694 [ms] (mean)
Time per request:       21.823 [ms] (mean, across all concurrent requests)
Transfer rate:          383.14 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    5  15.7      0      85
Processing:   128 10392 1884.6  10465   14760
Waiting:       13 10391 1885.1  10463   14759
Total:        129 10397 1875.3  10466   14760

Percentage of the requests served within a certain time (ms)
  50%  10466
  66%  10923
  75%  11178
  80%  11394
  90%  12019
  95%  13052
  98%  13947
  99%  14413
 100%  14760 (longest request)

With default install of laravel and nginx using php-fpm

Server Software:        nginx
Server Hostname:        localhost
Server Port:            19999

Document Path:          /
Document Length:        17594 bytes

Concurrency Level:      500
Time taken for tests:   71.707 seconds
Complete requests:      5000
Failed requests:        575
   (Connect: 0, Receive: 0, Length: 575, Exceptions: 0)
Total transferred:      83446650 bytes
HTML transferred:       77853450 bytes
Requests per second:    69.73 [#/sec] (mean)
Time per request:       7170.715 [ms] (mean)
Time per request:       14.341 [ms] (mean, across all concurrent requests)
Transfer rate:          1136.44 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   11  30.8      0     128
Processing:     0 6734 3248.0   7197   27931
Waiting:        0 6728 3253.1   7192   27930
Total:          1 6745 3241.8   7206   27931

Percentage of the requests served within a certain time (ms)
  50%   7206
  66%   7807
  75%   8257
  80%   8550
  90%   9115
  95%   9808
  98%  10848
  99%  17728
 100%  27931 (longest request)

`make up` does not work

~/laravel-roadrunner-in-docker$ make up

APP_UID=1000 APP_GID=1000 docker-compose up --detach --remove-orphans --scale queue=2 web queue cron
Building cron
Sending build context to Docker daemon  601.6kB
Step 1/12 : FROM --platform=linux/amd64 php:8.0.7-alpine as runtime
 ---> 6f9700ff5e24

...

Step 11/12 : RUN set -x     && composer dump-autoload -n --optimize     && chmod -R 777 ${COMPOSER_HOME}/cache     && php ./artisan storage:link
 ---> Running in d42dd55c5ffd
+ composer dump-autoload -n --optimize
Generating optimized autoload files
Generated optimized autoload files containing 3234 classes
+ chmod -R 777 /tmp/composer/cache
+ php ./artisan storage:link

In Application.php line 735:
                                                             
  Class "Facade\Ignition\IgnitionServiceProvider" not found  
                                                          
The command '/bin/sh -c set -x     && composer dump-autoload -n --optimize     && chmod -R 777 ${COMPOSER_HOME}/cache     && php ./artisan storage:link' returned a non-zero code: 1
ERROR: Service 'cron' failed to build : Build failed
make: *** [Makefile:36: up] Error 1

[Request] - Lumen

It would be great if there was also lumen quickstart for roadrunner.

Roadrunner is trying to serve file instead of going to route

I created the route /test on api.php but when I try to visit that route on my browser it gives a 500 error and in the docker logs the following appears:

2021-07-24T00:55:38.156Z DEBUG http http/plugin.go:122 200 GET https://localhost:8443/ {"remote": "172.19.0.1", "elapsed": "72.8851ms"}

2021-07-24T00:55:43.002Z DEBUG static static/plugin.go:148 no such file or directory {"error": "open /app/public/api/test: no such file or directory"}

2021-07-24T00:55:43.060Z INFO server server/plugin.go:262 "1"

2021-07-24T00:55:43.060Z DEBUG server server/plugin.go:232 worker destructed {"pid": 898}

2021-07-24T00:55:43.067Z ERROR server server/plugin.go:254 worker_watcher_wait: signal: killed; process_wait: signal: killed

I believe its trying to open the file /app/public/api/test instead of serving the route from laravel, but I dont know what to do to fix this.

Can't build image

Hi,
I cloned the project, run docker build -t laravel-roadrunner . and I got this:

#11 180.6 + strip --strip-all modules/intl.so
#11 181.0 WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.15/main: No such file or directory
#11 181.0 WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.15/community: No such file or directory
#11 182.0 + pecl install -o redis
------
executor failed running [/bin/sh -c set -x     && apk add --no-cache         postgresql-libs         icu-libs     && apk add --no-cache --virtual .build-deps         postgresql-dev         autoconf         openssl         make         g++     && CFLAGS="$CFLAGS -D_GNU_SOURCE" docker-php-ext-install -j$(nproc)         pdo_pgsql         sockets         opcache         pcntl         intl         1>/dev/null     && pecl install -o redis 1>/dev/null     && echo 'extension=redis.so' > ${PHP_INI_DIR}/conf.d/redis.ini     && wget -q "https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-amd64"          -O /usr/bin/supercronic     && chmod +x /usr/bin/supercronic     && mkdir /etc/supercronic     && echo '*/1 * * * * php /app/artisan schedule:run' > /etc/supercronic/laravel     && mkdir /etc/ssl/private     && openssl req -x509 -nodes -days 1095 -newkey rsa:2048         -subj "/C=CA/ST=QC/O=Company, Inc./CN=mydomain.com"         -addext "subjectAltName=DNS:mydomain.com"         -keyout /etc/ssl/private/selfsigned.key         -out /etc/ssl/certs/selfsigned.crt     && chmod 644 /etc/ssl/private/selfsigned.key     && docker-php-source delete     && apk del .build-deps     && rm -R /tmp/pear     && echo -e "\nopcache.enable=1\nopcache.enable_cli=1\nopcache.jit_buffer_size=32M\nopcache.jit=1235\n" >>         ${PHP_INI_DIR}/conf.d/docker-php-ext-opcache.ini     && php -m     && adduser         --disabled-password         --shell "/sbin/nologin"         --home "/nonexistent"         --no-create-home         --uid "10001"         --gecos ""         "appuser"     && mkdir /app /var/run/rr     && chown -R appuser:appuser /app /var/run/rr     && chmod -R 777 /var/run/rr]: exit code: 1

Ty

make test-cover: su: unknown user <local username>

Where dac.chartrand is my username on OSX.

$ make test-cover

docker-compose run --rm --user "0:0" -e 'XDEBUG_MODE=coverage' app sh -c 'echo "XDebug installing, please wait.." \
		&& apk --no-cache add autoconf make g++ 1>/dev/null && pecl install xdebug-3.0.4 1>/dev/null \
		&& docker-php-ext-enable xdebug 1>/dev/null \
		&& su dac.chartrand -s /bin/sh -c "composer phpunit"'
Creating laravel-roadrunner-in-docker_app_run ... done
XDebug installing, please wait..
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.13/main: No such file or directory
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.13/community: No such file or directory
su: unknown user dac.chartrand
ERROR: 1
make: *** [test-cover] Error 1

make install does not work

~/projects/experiments/laravel-roadrunner-in-docker   master  make install

Building app
Step 1/12 : FROM --platform=linux/amd64 php:8.0.9-alpine as runtime
 ---> d75050b53d70
Step 2/12 : COPY --from=composer:2.1.5 /usr/bin/composer /usr/bin/composer
 ---> Using cache
 ---> 3448bdd0f8c1
Step 3/12 : COPY --from=spiralscout/roadrunner:2.3.3 /usr/bin/rr /usr/bin/rr
 ---> Using cache
 ---> 3b4dc4e4a3a1
Step 4/12 : ENV COMPOSER_HOME="/tmp/composer"
 ---> Using cache
 ---> 987a6c6a96e5
Step 5/12 : RUN set -x     && apk add --no-cache         postgresql-libs         icu-libs     && apk add --no-cache --virtual .build-deps         postgresql-dev         autoconf         openssl         make         g++     && docker-php-ext-install -j$(nproc)         pdo_pgsql         sockets         opcache         pcntl         intl         1>/dev/null     && pecl install -o redis 1>/dev/null     && echo 'extension=redis.so' > ${PHP_INI_DIR}/conf.d/redis.ini     && wget -q "https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-amd64"          -O /usr/bin/supercronic     && chmod +x /usr/bin/supercronic     && mkdir /etc/supercronic     && echo '*/1 * * * * php /app/artisan schedule:run' > /etc/supercronic/laravel     && openssl req -x509 -nodes -days 1095 -newkey rsa:2048         -subj "/C=CA/ST=QC/O=Company, Inc./CN=mydomain.com"         -addext "subjectAltName=DNS:mydomain.com"         -keyout /etc/ssl/private/selfsigned.key         -out /etc/ssl/certs/selfsigned.crt     && chmod 644 /etc/ssl/private/selfsigned.key     && docker-php-source delete     && apk del .build-deps     && rm -R /tmp/pear     && echo -e "\nopcache.enable=1\nopcache.enable_cli=1\nopcache.jit_buffer_size=32M\nopcache.jit=1235\n" >>         ${PHP_INI_DIR}/conf.d/docker-php-ext-opcache.ini     && php -m     && adduser         --disabled-password         --shell "/sbin/nologin"         --home "/nonexistent"         --no-create-home         --uid "10001"         --gecos ""         "appuser"     && mkdir /app /var/run/rr     && chown -R appuser:appuser /app /var/run/rr     && chmod -R 777 /var/run/rr
 ---> Running in 4350d3a9b350
+ apk add --no-cache postgresql-libs icu-libs
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/x86_64/APKINDEX.tar.gz
(1/8) Installing libgcc (10.3.1_git20210424-r2)
(2/8) Installing libstdc++ (10.3.1_git20210424-r2)
(3/8) Installing icu-libs (67.1-r2)
(4/8) Installing gdbm (1.19-r0)
(5/8) Installing libsasl (2.1.27-r12)
(6/8) Installing libldap (2.4.58-r0)
(7/8) Installing libpq (13.3-r0)
(8/8) Installing postgresql-libs (13.3-r0)
Executing busybox-1.33.1-r3.trigger
OK: 48 MiB in 40 packages
+ apk add --no-cache --virtual .build-deps postgresql-dev autoconf openssl make g++
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/x86_64/APKINDEX.tar.gz
(1/28) Installing libffi (3.3-r2)

...

build/libtool.m4:39: AC_PROG_LIBTOOL is expanded from...
configure.ac:161: the top level
mkdir: can't create directory 'collator/.libs': File exists
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.14/main: No such file or directory
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.14/community: No such file or directory
+ pecl install -o redis
ERROR: Service 'app' failed to build : The command '/bin/sh -c set -x     && apk add --no-cache         postgresql-libs         icu-libs     && apk add --no-cache --virtual .build-deps         postgresql-dev         autoconf         openssl         make         g++     && docker-php-ext-install -j$(nproc)         pdo_pgsql         sockets         opcache         pcntl         intl         1>/dev/null     && pecl install -o redis 1>/dev/null     && echo 'extension=redis.so' > ${PHP_INI_DIR}/conf.d/redis.ini     && wget -q "https://github.com/aptible/supercronic/releases/download/v0.1.12/supercronic-linux-amd64"          -O /usr/bin/supercronic     && chmod +x /usr/bin/supercronic     && mkdir /etc/supercronic     && echo '*/1 * * * * php /app/artisan schedule:run' > /etc/supercronic/laravel     && openssl req -x509 -nodes -days 1095 -newkey rsa:2048         -subj "/C=CA/ST=QC/O=Company, Inc./CN=mydomain.com"         -addext "subjectAltName=DNS:mydomain.com"         -keyout /etc/ssl/private/selfsigned.key         -out /etc/ssl/certs/selfsigned.crt     && chmod 644 /etc/ssl/private/selfsigned.key     && docker-php-source delete     && apk del .build-deps     && rm -R /tmp/pear     && echo -e "\nopcache.enable=1\nopcache.enable_cli=1\nopcache.jit_buffer_size=32M\nopcache.jit=1235\n" >>         ${PHP_INI_DIR}/conf.d/docker-php-ext-opcache.ini     && php -m     && adduser         --disabled-password         --shell "/sbin/nologin"         --home "/nonexistent"         --no-create-home         --uid "10001"         --gecos ""         "appuser"     && mkdir /app /var/run/rr     && chown -R appuser:appuser /app /var/run/rr     && chmod -R 777 /var/run/rr' returned a non-zero code: 1
make: *** [Makefile:17: install] Ошибка 1

Docker version 20.10.8, build 3967b7d
docker-compose version 1.29.2, build 5becea4c
Ubuntu 20.04.2 LTS

make test-cover ERROR: 1

Every time when i trying make test-cover see this:

docker-compose run --rm --user "0:0" -e 'XDEBUG_MODE=coverage' app sh -c 'echo "XDebug installing, please wait.." \
                && apk --no-cache add autoconf make g++ 1>/dev/null && pecl install xdebug-3.0.4 1>/dev/null \
                && docker-php-ext-enable xdebug 1>/dev/null \
                && su opekunov -s /bin/sh -c "composer phpunit"'
Creating laravel-roadrunner-in-docker_app_run ... done
XDebug installing, please wait..
ERROR: 1
make: *** [test-cover] Error 1

In empty project too

Front-end development/building

I'm looking forward to the description of front-end development/building. It will be extremely useful.

Want to donate via patreon but couldn't make it :(

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.