Laravel Octane Dockerfile
A pretty configurable and production ready multi-stage Dockerfile for Octane powered Laravelish web services and microservices.
The Docker configuration provides the following setup:
- Debian Buster 10
- PHP 8.0
- Swoole Server
PHP extensions
And the following PHP extensions are included:
- Swoole
- OPcache
- Redis
- PCNTL
- BCMATH
- RDKAFKA
- INTL
- pdo_mysql
- MySQL Client
- zip
- cURL
- GD
- mbstring
Ports
Exposed ports of container:
Software | Port |
---|---|
Swoole | 9000 |
Usage
-
Clone this repository:
git clone [email protected]:exaco/laravel-octane-dockerfile.git
-
Copy cloned directory content into your Octane powered Laravel project
-
Change directory to your Laravel project
-
Build your image:
docker build -t <container-name>:<tag> .
-
Up the container:
docker run -p <port>:9000 --rm <container-name>:<tag>
-
Visit
http://localhost:<port>
Configuration
There are something that you maybe want to configure:
- Application request workers count in
supervisord.conf
- Max request count for request workers in
supervisord.conf
- The amount of workers available to process concurrent tasks in
supervisord.conf
- OPcache and JIT configurations in
opcache.ini
- PHP configurations in
php.ini
ENTRYPOINT
Bash script inentrypoint.sh
- Set OS timezone using the
--build-arg
option along with the build command
Contributing
Thank you for considering contributing! If you find an issue, or have a better way to do something, feel free to open an issue, or a PR.
License
This repository is open-sourced software licensed under the MIT license.