https://github.com/maymeow/php
:whale: SDK and Runtime for application development for PHP
https://github.com/maymeow/php
cakephp4 ci-cd developer-tools docker-image hacktoberfest laravel9 php8
Last synced: about 2 months ago
JSON representation
:whale: SDK and Runtime for application development for PHP
- Host: GitHub
- URL: https://github.com/maymeow/php
- Owner: MayMeow
- License: mit
- Created: 2022-10-09T19:06:12.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-29T10:23:11.000Z (about 1 year ago)
- Last Synced: 2025-03-27T05:51:12.441Z (12 months ago)
- Topics: cakephp4, ci-cd, developer-tools, docker-image, hacktoberfest, laravel9, php8
- Language: Dockerfile
- Homepage:
- Size: 29.3 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# PHP Docker for application development
Docker images that can be used for applicaiton development/ci-cd and for production. These images are based on official [PHP images](https://hub.docker.com/_/php)
[](https://ko-fi.com/D1D5DMOTA)
## SDK
Images for use in CI/CD and for application development
- Based on php-cli
This image contains:
- NodeJS and NPM
- Yarn
- Codesniffer
- phpcs
- phpcbf
- php-cs-fixer
- PSALM
- PHPUnit
- Xdebug
- Redis
- PHP Extensions: intl pdo_pgsql gd zip pdo_mysql
- phar-composer
- Image has set phar.readonly to 0 (zero) to allows you to create phar files
## Runtime
This image can be used for application in production environment
- based on php-fpm
This image contains:
- Redis
- PHP extensions: intl pdo_pgsql gd zip pdo_mysql
## Versions
Use `sdk:latest` for latest build or use wanted version e.g. `sdk:8.1.6`.
## Usage
For docker you can use `docker pull ghcr.io/maymeow/php/{imagename}:latest` where image name is `sdk` or `runtime`.
In docker compose use:
```yml
image: ghcr.io/maymeow/php/runtime:latest
# Or for SDK
image: ghcr.io/maymeow/php/sdk:latest
```
### Creating image for production environment
Runtime image does not contains composer so you need to install all composer dependencies first.
You can create image with multistep build like this
```Dockerfile
FROM ghcr.io/maymeow/php/sdk:latest AS build-env
WORKDIR /app
COPY . /app
RUN composer install --no-ansi --no-dev --no-interaction --no-plugins --no-progress --optimize-autoloader #--no-scripts
FROM ghcr.io/maymeow/php/runtime:latest
ARG user=www-data
COPY --from=build-env /app /var/www
RUN chown -R $user:$user /var/www
WORKDIR /var/www
RUN chmod -R 777 /var/www/logs
USER $user
```
License: MIT