legends810 commited on
Commit
9ccab9e
·
verified ·
1 Parent(s): 18e75aa

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -3
Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
  ###############################################################################
2
- # n8n for Hugging Face Spaces – bash-less, single-file Docker recipe
3
  ###############################################################################
4
  FROM docker.n8n.io/n8nio/n8n:latest
5
 
@@ -26,9 +26,11 @@ set -eu
26
  N8N_PORT="${PORT:-7860}"
27
  export N8N_PORT
28
 
29
- # Public URL for webhooks / editor
30
  if [ -n "${SPACE_ID:-}" ]; then
31
- APP_URL="https://${SPACE_ID}.hf.space"
 
 
32
  elif [ -n "${SPACE_HOST:-}" ]; then
33
  APP_URL="https://${SPACE_HOST}"
34
  else
 
1
  ###############################################################################
2
+ # n8n for Hugging Face Spaces – with correct URL generation
3
  ###############################################################################
4
  FROM docker.n8n.io/n8nio/n8n:latest
5
 
 
26
  N8N_PORT="${PORT:-7860}"
27
  export N8N_PORT
28
 
29
+ # Hugging Face URL generation fix
30
  if [ -n "${SPACE_ID:-}" ]; then
31
+ # SPACE_ID format: username/spacename
32
+ # Convert to: username-spacename.hf.space
33
+ APP_URL="https://$(echo "$SPACE_ID" | sed 's/\//-/').hf.space"
34
  elif [ -n "${SPACE_HOST:-}" ]; then
35
  APP_URL="https://${SPACE_HOST}"
36
  else