Keep API private on shared Docker network
Verify and deploy API / verify-deploy (push) Failing after 1m47s

This commit is contained in:
2026-09-18 22:52:25 +08:00
parent b2eacd5be9
commit 0a930f227b
7 changed files with 28 additions and 18 deletions
+2 -3
View File
@@ -20,9 +20,8 @@ jobs:
SOURCE_SERVER: ${{ gitea.server_url }}
SOURCE_REPOSITORY: ${{ gitea.repository }}
SOURCE_REVISION: ${{ gitea.sha }}
DEPLOY_PORT: ${{ vars.DEPLOY_PORT || '18082' }}
PUBLIC_BASE_URL: ${{ vars.PUBLIC_BASE_URL || '' }}
CORS_ORIGINS: ${{ vars.CORS_ORIGINS || 'http://47.83.180.156:3000,http://47.83.180.156:3002,http://localhost:3000,http://localhost:3002' }}
CORS_ORIGINS: ${{ vars.CORS_ORIGINS || 'http://localhost:3000,http://localhost:3002' }}
TEST_AUTH_ENABLED: ${{ vars.TEST_AUTH_ENABLED || 'true' }}
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
XHS_HUB_APP_ID: ${{ secrets.XHS_HUB_APP_ID }}
@@ -64,7 +63,7 @@ jobs:
test -n "$POSTGRES_PASSWORD"
export DEPLOY_IMAGE="pk-lab-server:$SOURCE_REVISION"
sh scripts/deploy.sh
curl --fail --silent --show-error "http://127.0.0.1:$DEPLOY_PORT/health"
docker compose -p pk-lab-production exec -T api python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=3)"
- name: Probe public endpoint
if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/main' && env.PUBLIC_BASE_URL != ''
run: curl --fail --silent --show-error --connect-timeout 10 --max-time 20 "${PUBLIC_BASE_URL%/}/health"