Unable to import workflows/credentials when running n8n w/ docker

I double-checked that I only have one n8n instance running. I also just completely wiped my VPS and started from scratch, and I’m still running into the same issue. I have a bash script that I use to bootstrap n8n. It’s pretty much the same as what I wrote above, but here it is so you can see exactly what I’m doing.

#!/bin/bash

mkdir ~/apps/n8n/

cat > ~/apps/n8n/docker-compose.yml << EOF
version: "3"

services:
  n8n:
    image: n8nio/n8n
    container_name: n8n
    network_mode: "host"
    volumes:
      - /home/adam/apps/n8n/data/:/home/node/.n8n/
    environment:
      - N8N_LISTEN_ADDRESS=127.0.0.1
      - N8N_PORT=8003
      - WEBHOOK_URL=https://${domain}
    restart: always
EOF

cd ~/apps/n8n/
docker compose up -d
cd ~/

# Import
docker cp ~/workflows.json n8n:/data/
docker cp ~/credentials.json n8n:/data/

docker exec -it n8n n8n import:workflow --input=workflows.json
docker exec -it n8n n8n import:credentials --input=credentials.json

I’m serving n8n via a caddy reverse proxy, but that shouldn’t have anything to do with this issue (I think).

n8n.${domain} {
  reverse_proxy localhost:8003
}