Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to PHP 8.1 #7

Merged
merged 11 commits into from
Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .assets/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
require __DIR__ . '/bootstrap_cli.php';
}


/*
* Set the full base URL.
* This URL is used as the base of all absolute links.
Expand Down
2 changes: 1 addition & 1 deletion .docker/php/docker-healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ if curl -v -o /dev/null http://localhost:8080; then
exit 0
fi

exit 1
exit 1
14 changes: 10 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@ jobs:
run: docker-compose build --build-arg UID=$(id -u) --build-arg ENV=dev
- name: Start
run: docker-compose up -d
- name: Wait for services
run: sleep 10
- name: Check CakePHP Welcome Page
run: curl -f -v -o /dev/null http://localhost:8080
uses: nick-fields/retry@v2
with:
timeout_seconds: 10
max_attempts: 10
command: curl -f -v -o /dev/null http://localhost:8080
- name: Check NGINX Files
run: curl -f -v -o /dev/null http://localhost:8080/css/home.css
uses: nick-fields/retry@v2
with:
timeout_seconds: 10
max_attempts: 5
command: curl -f -v -o /dev/null http://localhost:8080/css/home.css
2 changes: 1 addition & 1 deletion .github/workflows/image.yml.template
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fi
TAGS="${DOCKER_IMAGE}:${VERSION}"
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
TAGS="$TAGS,${DOCKER_IMAGE}:4.2-latest"
TAGS="$TAGS,${DOCKER_IMAGE}:4.4-latest"
fi
echo ::set-output name=tags::${TAGS}
-
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
# container
# @see https://hub.docker.com/repository/docker/cnizzardini/php-fpm-alpine
# @see https://github.com/cnizzardini/php-fpm-alpine/tree/php-8.0
FROM cnizzardini/php-fpm-alpine:8.0-latest AS cakephp_php
# @see https://github.com/cnizzardini/php-fpm-alpine/tree/php-8.1
FROM cnizzardini/php-fpm-alpine:8.1-latest AS cakephp_php

ARG ENV=prod
ARG UID=1000
Expand All @@ -24,9 +24,9 @@ fi
#
# application
#
COPY .docker/php/docker-healthcheck.sh /usr/local/bin/docker-healthcheck
RUN chmod +x /usr/local/bin/docker-healthcheck
HEALTHCHECK --interval=10s --timeout=3s --retries=3 CMD ["docker-healthcheck"]
#COPY .docker/php/docker-healthcheck.sh /usr/local/bin/docker-healthcheck
#RUN chmod +x /usr/local/bin/docker-healthcheck
#HEALTHCHECK --interval=10s --timeout=3s --retries=3 CMD ["docker-healthcheck"]

COPY .docker/php/docker-entrypoint.sh /usr/local/bin/docker-entrypoint
RUN chmod +x /usr/local/bin/docker-entrypoint
Expand Down
54 changes: 27 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
[![CakePHP](https://img.shields.io/badge/cakephp-4.2-red?logo=cakephp)](https://book.cakephp.org/4/en/index.html)
[![Docker](https://img.shields.io/badge/docker-ffffff.svg?logo=docker)](.docker)
[![Kubernetes](https://img.shields.io/badge/kubernetes-D3D3D3.svg?logo=kubernetes)](.kube)
[![PHP](https://img.shields.io/badge/php-7.4-8892BF.svg?logo=php)](https://hub.docker.com/_/php)
[![PHP](https://img.shields.io/badge/php-8.1-8892BF.svg?logo=php)](https://hub.docker.com/_/php)
[![NGINX](https://img.shields.io/badge/nginx-1.19-009639.svg?logo=nginx)](https://hub.docker.com/_/nginx)
[![MySQL](https://img.shields.io/badge/mysql-8-00758F.svg?logo=mysql)](https://hub.docker.com/_/mysql)

A [mixerapi/mixerapi](https://github.com/mixerapi/mixerapi) application template for Docker Compose and Kubernetes
based on the official [cakephp/app 4.2](https://github.com/cakephp/app) template.
based on the official [cakephp/app 4.4](https://github.com/cakephp/app) template.

This project has been forked from [cnizzardini/cakephp-docker](https://github.com/cnizzardini/cakephp-docker).

Expand All @@ -19,11 +19,11 @@ This project has been forked from [cnizzardini/cakephp-docker](https://github.co
- [Docker 20](https://docs.docker.com/engine/release-notes/) or higher
- Make

| Service | Host:Port | Docker Host | Image |
| ----------- | ----------- | ----------- | ----------- |
| PHP8.0-FPM w/ Xdebug 3 | - | php | [cnizzardini/php-fpm-alpine:8.0-latest](https://hub.docker.com/r/cnizzardini/php-fpm-alpine) |
| NGINX 1.19 | localhost:8080 | web | [nginx:1.19-alpine](https://hub.docker.com/_/nginx) |
| MySQL 8 | localhost:3607 | db | [library/mysql:8](https://hub.docker.com/_/mysql) |
| Service | Host:Port | Docker Host | Image |
|------------------------|----------------|-------------|----------------------------------------------------------------------------------------------|
| PHP8.1-FPM w/ Xdebug 3 | - | php | [cnizzardini/php-fpm-alpine:8.1-latest](https://hub.docker.com/r/cnizzardini/php-fpm-alpine) |
| NGINX 1.19 | localhost:8080 | web | [nginx:1.19-alpine](https://hub.docker.com/_/nginx) |
| MySQL 8 | localhost:3607 | db | [library/mysql:8](https://hub.docker.com/_/mysql) |


- [Installation](#installation)
Expand Down Expand Up @@ -67,26 +67,26 @@ After install browse to [http://localhost:8080](http://localhost:8080) to see th
A [Makefile](Makefile) is provided with some optional commands for your convenience. Please review the Makefile as
these commands are not exact aliases of docker-compose commands.

| Make Command | Description |
| ----------- | ----------- |
| `make` | Shows all make target commands |
| `make init` | Runs docker build, docker-compose up, and copies over env files |
| `make init.nocache` | Same as make.init but builds with --no-cache |
| `make start` | Starts services `docker-compose -f .docker/docker-compose.yml start` |
| `make stop` | Stops services `docker-compose -f .docker/docker-compose.yml stop` |
| `make up` | Create and start containers `docker-compose -f .docker/docker-compose.yml up -d` |
| `make down` | Take down and remove all containers `docker-compose -f .docker/docker-compose.yml down` |
| `make restart` | Restarts services `docker-compose -f .docker/docker-compose.yml restart` |
| `make php.sh` | PHP terminal `docker exec -it --user cakephp <PHP_CONTAINER> sh` |
| `make php.restart` | Restarts the PHP container |
| `make db.sh` | DB terminal `docker exec -it <DB_CONTAINER> sh` |
| `make db.mysql` | MySQL terminal `mysql -u root -h 0.0.0.0 -p --port 3307` |
| `make web.sh` | Web terminal `docker exec -it <WEB_CONTAINER> sh` |
| `make xdebug.on` | Restarts PHP container with xdebug.mode set to debug,coverage |
| `make xdebug.off` | Restarts PHP container with xdebug.mode set to off |
| `make composer.install` | `docker exec <PHP_CONTAINER> composer install --no-interaction` |
| `make composer.test` | `docker exec <PHP_CONTAINER> composer test` |
| `make composer.check` | `docker exec <PHP_CONTAINER> composer check` |
| Make Command | Description |
|-------------------------|-----------------------------------------------------------------------------------------|
| `make` | Shows all make target commands |
| `make init` | Runs docker build, docker-compose up, and copies over env files |
| `make init.nocache` | Same as make.init but builds with --no-cache |
| `make start` | Starts services `docker-compose -f .docker/docker-compose.yml start` |
| `make stop` | Stops services `docker-compose -f .docker/docker-compose.yml stop` |
| `make up` | Create and start containers `docker-compose -f .docker/docker-compose.yml up -d` |
| `make down` | Take down and remove all containers `docker-compose -f .docker/docker-compose.yml down` |
| `make restart` | Restarts services `docker-compose -f .docker/docker-compose.yml restart` |
| `make php.sh` | PHP terminal `docker exec -it --user cakephp <PHP_CONTAINER> sh` |
| `make php.restart` | Restarts the PHP container |
| `make db.sh` | DB terminal `docker exec -it <DB_CONTAINER> sh` |
| `make db.mysql` | MySQL terminal `mysql -u root -h 0.0.0.0 -p --port 3307` |
| `make web.sh` | Web terminal `docker exec -it <WEB_CONTAINER> sh` |
| `make xdebug.on` | Restarts PHP container with xdebug.mode set to debug,coverage |
| `make xdebug.off` | Restarts PHP container with xdebug.mode set to off |
| `make composer.install` | `docker exec <PHP_CONTAINER> composer install --no-interaction` |
| `make composer.test` | `docker exec <PHP_CONTAINER> composer test` |
| `make composer.check` | `docker exec <PHP_CONTAINER> composer check` |

### PHP

Expand Down
Empty file modified app/.gitkeep
100644 → 100755
Empty file.