https://github.com/phly/phly-docker-php-swoole
Docker image based on php:7.2-cli that adds the Swoole extension and Composer.
https://github.com/phly/phly-docker-php-swoole
Last synced: over 1 year ago
JSON representation
Docker image based on php:7.2-cli that adds the Swoole extension and Composer.
- Host: GitHub
- URL: https://github.com/phly/phly-docker-php-swoole
- Owner: phly
- Created: 2018-09-03T18:03:58.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-01-05T02:27:25.000Z (over 4 years ago)
- Last Synced: 2025-01-19T13:50:03.552Z (over 1 year ago)
- Language: Dockerfile
- Size: 8.79 KB
- Stars: 7
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# phly-docker-php-swoole
This repository provides tools for building and pushing the following Docker
images:
- **mwop/phly-docker-php-swoole:7.4**: an image based on php:7.4-cli that
includes [Composer](https://getcomposer.org), the hirak/prestissimo Composer
plugin, and the [Swoole](https://swoole.co.uk) extension.
- **mwop/phly-docker-php-swoole:7.4-alpine**: an image based on
php:7.3-cli-alpine that includes [Composer](https://getcomposer.org), the
hirak/prestissimo Composer plugin, and the [Swoole](https://swoole.co.uk)
extension.
Each creates the directory `/var/www/public`, and the entrypoint
`/usr/local/bin/entrypoint`, which will run the application. By default, this
assumes a file `/var/www/public/index.php`, and the entrypoint will execute this
using the PHP binary.
## Extending the image
As an example of extending the image, consider the following, which builds and
runs an [Expressive](https://getexpressive.org) application:
```Dockerfile
# DOCKER-VERSION 1.3.2
FROM mwop/phly-docker-php-swoole:7.4
# PHP Extensions
RUN docker-php-ext-install -j$(nproc) bcmath bz2 intl opcache zip
# Overwrite entrypoint
COPY etc/bin/php-entrypoint /usr/local/bin/entrypoint
# Project files
COPY bin /var/www/bin
COPY composer.json /var/www/
COPY composer.lock /var/www/
COPY templates /var/www/templates
COPY config /var/www/config
COPY src /var/www/src
COPY data /var/www/data
COPY public /var/www/public
# Build project
WORKDIR /var/www
RUN composer install --quiet --no-ansi --no-dev --no-interaction --no-progress --no-scripts --no-plugins --optimize-autoloader && \
composer docker:site
```
where `php-entrypoint` looks like the following:
```php
#!/bin/sh
/usr/bin/env php public/index.php start
```