Skip to content

Commit bd6ba54

Browse files
committed
fix(ci): Simplify Docker workflow by removing unnecessary steps and adding healthcheck configuration.
1 parent df0ab95 commit bd6ba54

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,8 @@ jobs:
2525
- name: Checkout.
2626
uses: actions/checkout@v5
2727

28-
- name: Docker version.
29-
run: |
30-
docker version
31-
docker compose version
32-
3328
- name: Build and start containers.
34-
run: docker compose up -d --build
35-
36-
- name: Wait for readiness.
37-
run: |
38-
for i in {1..60}; do
39-
if docker exec yii2-apache sh -lc "curl -ksS -o /dev/null -w '%{http_code}' https://localhost | grep -qE '200|302'"; then
40-
echo "Service is ready"; exit 0; fi
41-
sleep 2
42-
done
43-
echo "Service not ready"; docker logs yii2-apache; exit 1
29+
run: docker compose up -d --build --wait
4430

4531
- name: Codeception build.
4632
run: docker exec yii2-apache vendor/bin/codecept build

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- Bug #180: Update paths to ignore in GitHub Actions workflow for pull requests and pushes (@terabytesoftw)
2020
- Bug #184: Update Docker commands and badge links in `README.md` for accurate workflow status (@terabytesoftw)
2121
- Bug #186: Rename steps for clarity in GitHub Actions workflow `build.yml` (@terabytesoftw)
22+
- Bug #190: Simplify Docker workflow by removing unnecessary steps and adding healthcheck configuration (@terabytesoftw)
2223

2324
## 0.1.0 August 31, 2025
2425

docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ services:
1616
TZ: "UTC"
1717
YII_DEBUG: "${YII_DEBUG:-false}"
1818
YII_ENV: "${YII_ENV:-prod}"
19+
healthcheck:
20+
test: ["CMD-SHELL", "curl -f http://localhost/ || exit 1"]
21+
interval: 10s
22+
timeout: 5s
23+
retries: 5
24+
start_period: 25s
1925
ports:
2026
- '8080:80'
2127
- '8443:443'

0 commit comments

Comments
 (0)