4caba29984
deploy / deploy (push) Failing after 4s
docker-compose.yml: - Add top-level name: soroushasadi so Compose uses a stable project name regardless of which temp directory the runner checks out into. Without this, each run gets a different project name and the old container is not recognised as an orphan — it stays bound to port 3000 and the new container fails to start. - Fix healthcheck: wget is not in node:20-slim; use Node 20's built-in fetch instead. - Set NODE_IMAGE default to the Nexus docker-group mirror. Workflows: - Add GIT_SSL_NO_VERIFY=true to checkout steps (self-signed cert on git.soroushasadi.com). - Pass NODE_IMAGE to build step in deploy. - Add git remote remove guard to CI checkout (prevents failure on second run in the same workspace). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
36 lines
984 B
YAML
36 lines
984 B
YAML
name: soroushasadi
|
|
|
|
services:
|
|
web:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
args:
|
|
NODE_IMAGE: ${NODE_IMAGE:-mirror.soroushasadi.com/repository/docker-group/node:20-slim}
|
|
NPM_TOKEN: ${NPM_TOKEN:-}
|
|
image: soroushasadi-site:latest
|
|
container_name: soroushasadi-site
|
|
restart: unless-stopped
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
NODE_ENV: production
|
|
DATA_DIR: /data
|
|
ADMIN_PASSWORD: ${ADMIN_PASSWORD:?set ADMIN_PASSWORD}
|
|
ADMIN_SESSION_SECRET: ${ADMIN_SESSION_SECRET:?set ADMIN_SESSION_SECRET}
|
|
RESEND_API_KEY: ${RESEND_API_KEY:-}
|
|
CONTACT_INBOX: ${CONTACT_INBOX:-}
|
|
CONTACT_FROM: ${CONTACT_FROM:-}
|
|
volumes:
|
|
- cms-data:/data
|
|
healthcheck:
|
|
test: ["CMD", "node", "-e",
|
|
"fetch('http://127.0.0.1:3000/').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 30s
|
|
|
|
volumes:
|
|
cms-data:
|