Closed hotrush closed 4 years ago
I'll check what we can do after the official announcement :)
There will be various config parameters in users' applications. Each app should have its own Dockerfile and CI/CD pipeline for building production images.
Without considering any customized configuration, it's easy to write a sample Dockerfile:
FROM php:7.4-cli-alpine
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
&& curl -sSL -o /usr/bin/composer 'https://getcomposer.org/composer-stable.phar' \
&& chmod +x /usr/bin/composer
ADD . /usr/src/spiral
WORKDIR /usr/src/spiral
RUN composer install --no-progress --no-dev -o --prefer-dist \
&& ./vendor/bin/spiral get-binary
RUN cp .env.sample .env \
&& php app.php encrypt:key -m .env \
&& php app.php configure -vv
CMD ["./spiral", "serve", "-v"]
@krwu thanks, i've made something like this myself.
But met several issues:
@hotrush I tested the Dockerfile above, relative path works.
For restarting the server on code changing, check out this: docker/compose#184, I'm not sure if it can help you.
@krwu actually i don't think that i need to rebuild container on code changes, just need to restart rr somehow. For http next config works for me:
pool:
numWorkers: 1
maxJobs: 1
Maybe same options exist for grpc server?
Yes it does exists for GRPC and jobs. also read about reload service (from 1.6.2).
@wolfy-j thanks, will try, just didn't find any docs for grpc server at spiral or roadrunner websites, will try experimentally. I've seen reload feature, but it looks too resources-intensive with docker, maybe because of slow fs or smth
You really need to have a Dockerfile in this repo 😃