[Unit]
Description=IronClaw AI Assistant
After=cloud-sql-proxy.service docker.service
Requires=cloud-sql-proxy.service

[Service]
Type=simple
EnvironmentFile=/opt/ironclaw/.env
# Pin to a specific version tag or digest instead of :latest to prevent
# uncontrolled deployments. Update IRONCLAW_VERSION in /opt/ironclaw/.env
# or replace the tag below when deploying a new release.
ExecStartPre=/bin/bash -c 'docker pull us-central1-docker.pkg.dev/ironclaw-prod/ironclaw/agent:${IRONCLAW_VERSION:-latest}'
ExecStart=/bin/bash -c 'docker run --rm \
  --name ironclaw \
  --env-file /opt/ironclaw/.env \
  -p 3000:3000 \
  us-central1-docker.pkg.dev/ironclaw-prod/ironclaw/agent:${IRONCLAW_VERSION:-latest} \
  --no-onboard'
ExecStop=/usr/bin/docker stop ironclaw
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
