Skip to content

Commit f7a6243

Browse files
Update Docker configuration to use PHP 8.5 and optimize Composer commands. (#328)
1 parent 13106d8 commit f7a6243

File tree

4 files changed

+21
-7
lines changed

4 files changed

+21
-7
lines changed

.github/workflows/docker.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ jobs:
3636
- name: Build and start containers.
3737
run: docker compose up -d --build --wait
3838

39-
- name: Composer update.
40-
run: docker compose run --rm php composer update --prefer-dist --no-progress --no-suggest --no-interaction
39+
- name: Composer install.
40+
run: docker compose run --rm php composer install --prefer-dist --no-progress --optimize-autoloader
4141

4242
- name: Codeception build.
4343
run: docker compose exec -T php vendor/bin/codecept build
4444

4545
- name: Codeception tests.
46-
run: docker compose exec -T php vendor/bin/codecept run Functional,Unit
46+
run: docker compose exec -T php vendor/bin/codecept run

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ features to your application.
1616
[![Latest Stable Version](https://img.shields.io/packagist/v/yiisoft/yii2-app-basic.svg?style=for-the-badge&label=Stable&logo=packagist)](https://packagist.org/packages/yiisoft/yii2-app-basic)
1717
[![Total Downloads](https://img.shields.io/packagist/dt/yiisoft/yii2-app-basic.svg?style=for-the-badge&label=Downloads)](https://packagist.org/packages/yiisoft/yii2-app-basic)
1818
[![build](https://img.shields.io/github/actions/workflow/status/yiisoft/yii2-app-basic/build.yml?style=for-the-badge&logo=github&label=Build)](https://github.com/yiisoft/yii2-app-basic/actions?query=workflow%3Abuild)
19-
[![Static Analysis](https://img.shields.io/github/actions/workflow/status/yiisoft/yii2-app-basic/static.yml?style=for-the-badge&label=Static&logo=github)](https://github.com/yiisoft/yii2-app-basic/actions/workflows/static.yml)
2019
[![codecov](https://img.shields.io/codecov/c/github/yiisoft/yii2-app-basic.svg?style=for-the-badge&logo=codecov&logoColor=white&label=Codecov)](https://codecov.io/gh/yiisoft/yii2-app-basic)
20+
[![Static Analysis](https://img.shields.io/github/actions/workflow/status/yiisoft/yii2-app-basic/static.yml?style=for-the-badge&label=Static)](https://github.com/yiisoft/yii2-app-basic/actions/workflows/static.yml)
2121

2222
## Docker
2323

@@ -105,9 +105,14 @@ You can then access the application through the following URL:
105105

106106
http://127.0.0.1:8000
107107

108+
Run tests inside the container
109+
110+
docker compose exec -T php vendor/bin/codecept build
111+
docker compose exec -T php vendor/bin/codecept run
112+
108113
**NOTES:**
109114
- Minimum required Docker engine version `17.04` for development (see [Performance tuning for volume mounts](https://docs.docker.com/docker-for-mac/osxfs-caching/))
110-
- The default configuration uses a host-volume in your home directory `.docker-composer` for composer caches
115+
- The default configuration uses a host-volume in your home directory `~/.composer-docker/cache` for Composer caches
111116

112117

113118
CONFIGURATION

docker-compose.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
services:
22
php:
3-
image: yiisoftware/yii2-php:8.2-apache
3+
image: yiisoftware/yii2-php:8.5-apache-latest
44
volumes:
55
- ~/.composer-docker/cache:/root/.composer/cache:delegated
66
- ./:/app:delegated
77
ports:
88
- '8000:80'
9+
healthcheck:
10+
test: [
11+
"CMD-SHELL",
12+
"if [ \"$(stat -c '%U' /app/runtime)\" != 'www-data' ] || [ \"$(stat -c '%U' /app/web/assets)\" != 'www-data' ]; then chown -R www-data:www-data /app/runtime /app/web/assets && chmod -R ug+rwX /app/runtime /app/web/assets; fi && runuser -u www-data -- touch /app/runtime/test_write && rm /app/runtime/test_write && exit 0 || exit 1",
13+
]
14+
interval: 30s
15+
timeout: 10s
16+
retries: 3
17+
start_period: 10s

tests/Acceptance.suite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ actor: AcceptanceTester
88
modules:
99
enabled:
1010
- PhpBrowser:
11-
url: http://localhost:8080
11+
url: http://localhost
1212
- Yii2:
1313
part: orm
1414
entryScript: index-test.php

0 commit comments

Comments
 (0)