-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Upgrade Docker to PHP 8.4 and MySQL 8.0, remove composer.lock.
#581
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
Merged
Merged
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
7d2250e
Update `README.md` and add Docker support with updated configurations…
terabytesoftw aedc82c
Refactor `README.md` to consolidate installation instructions and req…
terabytesoftw 62e8492
Add Codeception build and run steps to Docker workflow; update test e…
terabytesoftw a0b4a6e
Fix Docker CI.
terabytesoftw 8edfa3e
Fix Docker CI.
terabytesoftw b7c9ddb
Remove unnecessary Composer update and health check steps from Docker…
terabytesoftw ef1e83d
Apply fixed Copilot review.
terabytesoftw 2e7bfe5
FIx Docker CI.
terabytesoftw 2fe7d93
Apply fixed Copilot review.
terabytesoftw 1fc7ed9
Apply fixed Copilot review.
terabytesoftw 64b59d6
Apply fixed Copilot review.
terabytesoftw 291af6a
Apply fixed Copilot review.
terabytesoftw c42d823
Apply fixed Copilot review.
terabytesoftw 8ecea23
Apply fixed Copilot review.
terabytesoftw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| name: docker | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| pull_request: &ignore-paths | ||
| paths-ignore: | ||
| - ".bowerrc" | ||
| - ".editorconfig" | ||
| - ".git-blame-ignore-revs" | ||
| - ".gitattributes" | ||
| - ".github/CONTRIBUTING.md" | ||
| - ".github/FUNDING.yml" | ||
| - ".github/ISSUE_TEMPLATE.md" | ||
| - ".github/PULL_REQUEST_TEMPLATE.md" | ||
| - ".github/SECURITY.md" | ||
| - ".gitignore" | ||
| - "LICENSE.md" | ||
| - "README.md" | ||
| - "requirements.php" | ||
| - "Vagrantfile" | ||
|
|
||
| push: *ignore-paths | ||
|
|
||
| jobs: | ||
| apache: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout. | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Build and start containers. | ||
| run: docker compose up -d --build --wait | ||
|
|
||
| - name: Composer install. | ||
| run: docker compose exec -T frontend composer install --prefer-dist --no-interaction | ||
|
terabytesoftw marked this conversation as resolved.
Outdated
|
||
|
|
||
| - name: Initialize application. | ||
| run: docker compose exec -T frontend php /app/init --env=Development --overwrite=All | ||
|
|
||
|
terabytesoftw marked this conversation as resolved.
|
||
| - name: Configure database for Docker. | ||
| run: | | ||
| docker compose exec -T frontend bash -c ' | ||
| for f in /app/common/config/main-local.php /app/common/config/test-local.php; do | ||
| if [ -f "$f" ]; then | ||
| sed -i \ | ||
| -e "s|host=localhost|host=mysql|g" \ | ||
| -e "s|'\''username'\'' => '\''root'\''|'\''username'\'' => '\''yii2advanced'\''|g" \ | ||
| -e "s|'\''password'\'' => '\'''\''|'\''password'\'' => '\''secret'\''|g" \ | ||
|
terabytesoftw marked this conversation as resolved.
|
||
| "$f" | ||
|
terabytesoftw marked this conversation as resolved.
|
||
| fi | ||
| done | ||
| ' | ||
|
|
||
| - name: Wait for MySQL to be ready. | ||
| run: | | ||
| ready=0 | ||
| for i in $(seq 1 60); do | ||
| docker compose exec -T frontend php -r "new PDO('mysql:host=mysql;dbname=yii2advanced', 'yii2advanced', 'secret');" 2>/dev/null && { ready=1; break; } | ||
| sleep 3 | ||
| done | ||
|
terabytesoftw marked this conversation as resolved.
|
||
| if [ "$ready" -ne 1 ]; then | ||
| echo "MySQL did not become ready after 60 attempts." | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Create test database. | ||
| run: | | ||
| docker compose exec -T mysql mysql -uroot -pverysecret -e " | ||
| CREATE DATABASE IF NOT EXISTS yii2advanced_test; | ||
| GRANT ALL PRIVILEGES ON yii2advanced_test.* TO 'yii2advanced'@'%'; | ||
| FLUSH PRIVILEGES; | ||
| " | ||
|
|
||
| - name: Run database migrations. | ||
| run: docker compose exec -T frontend php /app/yii migrate --interactive=0 | ||
|
|
||
| - name: Run test database migrations. | ||
| run: docker compose exec -T frontend php /app/yii_test migrate --interactive=0 | ||
|
|
||
| - name: Codeception build. | ||
| run: docker compose exec -T frontend vendor/bin/codecept build | ||
|
|
||
| - name: Codeception run. | ||
| run: docker compose exec -T frontend vendor/bin/codecept run | ||
|
terabytesoftw marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| FROM yiisoftware/yii2-php:8.1-apache | ||
| FROM yiisoftware/yii2-php:8.4-apache | ||
|
|
||
| # Change document root for Apache | ||
| RUN sed -i -e 's|/app/web|/app/backend/web|g' /etc/apache2/sites-available/000-default.conf |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.