Skip to content

Commit c5214d5

Browse files
committed
Apply fixed review coderabbitai nitpick comments.
1 parent 4813ad0 commit c5214d5

File tree

4 files changed

+22
-13
lines changed

4 files changed

+22
-13
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,22 @@ jobs:
2525
- name: Checkout.
2626
uses: actions/checkout@v5
2727

28-
- name: Install docker compose.
28+
- name: Show docker version.
2929
run: |
30-
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
31-
sudo chmod +x /usr/local/bin/docker-compose
32-
docker-compose --version
30+
docker version
31+
docker compose version
3332
3433
- name: Build and start containers.
35-
run: docker-compose up -d --build
34+
run: docker compose up -d --build
3635

37-
- name: Wait for container to be ready.
36+
- name: Wait for readiness.
3837
run: |
39-
echo "Waiting 30 seconds for container initialization..."
40-
sleep 30
41-
docker logs yii2-nginx
38+
for i in {1..60}; do
39+
if docker exec yii2-nginx 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-nginx; exit 1
4244
4345
- name: Codeceptcion build.
4446
run: docker exec yii2-nginx vendor/bin/codecept build

docker/nginx/default.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ server {
44
server_name localhost;
55

66
# Redirect all HTTP to HTTPS
7-
return 301 https://localhost:8445$request_uri;
7+
return 301 https://$host$request_uri;
88
}
99

1010
# HTTPS server
@@ -82,7 +82,7 @@ server {
8282
# Static files handling with caching
8383
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
8484
expires 1y;
85-
add_header Cache-Control "web, immutable";
85+
add_header Cache-Control "public, immutable";
8686
try_files $uri =404;
8787
}
8888

docker/php/php.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
date.timezone = UTC
33
display_errors = Off
44
expose_php = Off
5+
log_errors = On
6+
error_log = /proc/self/fd/2
57
memory_limit = 512M
68
post_max_size = 150M
79
session.auto_start = Off

docker/supervisor/conf.d/queue.conf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
process_name=%(program_name)s_%(process_num)02d
33
command=/usr/local/bin/php /app/yii queue/listen --verbose=1 --color=0
44
autorestart=true
5-
autostart=true
6-
numprocs=4
5+
# Enable only after installing yiisoft/yii2-queue; flipped on via image build or entrypoint.
6+
autostart=false
7+
# Keep demo light; can be raised later.
8+
numprocs=1
9+
stopasgroup=true
10+
killasgroup=true
11+
stopsignal=TERM
712
stderr_logfile=/dev/stderr
813
stderr_logfile_maxbytes=0
914
stdout_logfile=/dev/stdout

0 commit comments

Comments
 (0)