https://github.com/dnj/php-alpine
Yet Another PHP + Alpine Docker Image.
https://github.com/dnj/php-alpine
Last synced: 5 months ago
JSON representation
Yet Another PHP + Alpine Docker Image.
- Host: GitHub
- URL: https://github.com/dnj/php-alpine
- Owner: dnj
- License: mit
- Created: 2021-10-10T09:34:43.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-10-27T15:25:13.000Z (over 1 year ago)
- Last Synced: 2024-10-27T17:54:15.366Z (over 1 year ago)
- Language: Dockerfile
- Size: 136 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP-Alpine
PHP running on alpine base Docker Image with or without Nginx 🐳

[](https://github.com/dnj/php-alpine/blob/master/LICENSE)
[](https://github.com/dnj/php-alpine/stargazers)
[](https://github.com/dnj/php-alpine/network/members)
[](https://github.com/dnj/php-alpine/watchers)
[](https://github.com/dnj/php-alpine/issues)
[](https://github.com/dnj/php-alpine/pulls)
[](https://github.com/dnj)

## Pull it from Github Registry
To pull the docker image:
```bash
docker pull ghcr.io/dnj/php-alpine:8.3-mysql-nginx
```
## Usage
To run from current dir
```bash
docker run -v $(pwd):/var/www/html -p 80:80 ghcr.io/dnj/php-alpine:8.3-mysql-nginx
```
## What's Included
- [Composer](https://getcomposer.org/) ( v2 - updated )
- [Tasker](https://github.com/adhocore/gronx) instead of CRON
- [Go-Supervisor](https://github.com/QPod/supervisord)
## Other Details
- Alpine base image
## PHP Extension
- opcache
- mysqli or pgsql
- pdo
- pdo_mysql or pdo_pgsql
- sockets
- json
- intl
- gd
- xml
- zip
- bz2
- pcntl
- bcmath
- inotify
- redis
- memcached
- exif
- dom
- soap
- ssh2
## Adding other PHP Extension
You can add additional PHP Extensions by running `docker-ext-install` command. Don't forget to install necessary dependencies for required extension.
```bash
FROM ghcr.io/dnj/php-alpine:8.3-mysql-nginx
RUN docker-php-ext-install xdebug
```
## Adding a cronjob
```bash
FROM ghcr.io/dnj/php-alpine:8.3-mysql-nginx
echo '0 * * * * /usr/local/bin/php /var/www/artisan schedule:run >> /dev/null 2>&1' >> /etc/crontab
```
## Adding custom Supervisor config
You can add your own Supervisor config inside `/etc/supervisor.d/`. File extension needs to be `*.ini`. By default this image added `nginx`, `php-fpm` and `taker` process in supervisor.
E.g: For a nodejs program you can make file `my-websocket-app.ini`
```ini
[program:my-websocket-app]
process_name=%(program_name)s
command=node /app/socket.js
autostart=true
autorestart=true
redirect_stderr=true
```
On your Docker image
```bash
FROM ghcr.io/dnj/php-alpine:latest
ADD my-websocket-app.ini /etc/supervisor.d/
```
For more details please refrer to [QPod/supervisord](https://github.com/QPod/supervisord/blob/main/doc/doc-config.md) documentions.
## Bug Reporting
If you find any bugs, please report it by submitting an issue on our [issue page](https://github.com/dnj/php-alpine/issues) with a detailed explanation. Giving some screenshots would also be very helpful.
## Feature Request
You can also submit a feature request on our [issue page](https://github.com/dnj/php-alpine) or [discussions](https://github.com/dnj/php-alpine/discussions) and we will try to implement it as soon as possible.