fix: add backend health check + HTTPS nginx config with SSL support
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 12s
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 12s
This commit is contained in:
parent
33f1cc1859
commit
9e5fb7cb40
@ -25,14 +25,32 @@ jobs:
|
||||
- name: Remove old container
|
||||
run: docker rm zhixi-api 2>/dev/null || true
|
||||
|
||||
- name: Ensure infrastructure is ready
|
||||
run: |
|
||||
# Create network if missing
|
||||
docker network inspect zhixi-net >/dev/null 2>&1 || docker network create zhixi-net
|
||||
|
||||
# Start MySQL + Redis via docker compose (try common locations)
|
||||
for dir in /opt/zhixi /root/zhixi /tmp/api-server; do
|
||||
if [ -f "$dir/docker-compose.yml" ]; then
|
||||
cd "$dir" && docker compose up -d mysql redis 2>/dev/null || true
|
||||
break
|
||||
fi
|
||||
done
|
||||
sleep 3
|
||||
|
||||
- name: Start new container
|
||||
run: |
|
||||
ENV_FILE=""
|
||||
if [ -f /etc/zhixi/.env.production ]; then
|
||||
ENV_FILE="--env-file /etc/zhixi/.env.production"
|
||||
fi
|
||||
docker run -d \
|
||||
--name zhixi-api \
|
||||
--network zhixi-net \
|
||||
--restart unless-stopped \
|
||||
-p 3001:3000 \
|
||||
--env-file /etc/zhixi/.env.production \
|
||||
$ENV_FILE \
|
||||
zhixi-api:latest
|
||||
|
||||
- name: Health check
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user