andrewrreed HF staff commited on
Commit
f7ed979
·
1 Parent(s): e000bb0

debug networking

Browse files
Files changed (2) hide show
  1. Dockerfile +6 -1
  2. docker-entrypoint-wrapper.sh +17 -3
Dockerfile CHANGED
@@ -5,13 +5,18 @@ USER root
5
  # Install PostgreSQL and necessary dependencies
6
  RUN apk update && apk add --no-cache \
7
  postgresql \
8
- postgresql-contrib
 
 
9
 
10
  # Set up environment variables
11
  ENV DATABASE_URL=postgresql://postgres:postgres@localhost:5432/node
12
  ENV NEXTAUTH_SECRET=mysecret
13
  ENV SALT=mysalt
14
  ENV ENCRYPTION_KEY=0000000000000000000000000000000000000000000000000000000000000000
 
 
 
15
 
16
  # Copy and set up the wrapper script
17
  COPY docker-entrypoint-wrapper.sh /docker-entrypoint-wrapper.sh
 
5
  # Install PostgreSQL and necessary dependencies
6
  RUN apk update && apk add --no-cache \
7
  postgresql \
8
+ postgresql-contrib \
9
+ net-tools \
10
+ iproute2
11
 
12
  # Set up environment variables
13
  ENV DATABASE_URL=postgresql://postgres:postgres@localhost:5432/node
14
  ENV NEXTAUTH_SECRET=mysecret
15
  ENV SALT=mysalt
16
  ENV ENCRYPTION_KEY=0000000000000000000000000000000000000000000000000000000000000000
17
+ ENV NODE_ENV=production
18
+ ENV HOSTNAME="0.0.0.0"
19
+ ENV PORT=3000
20
 
21
  # Copy and set up the wrapper script
22
  COPY docker-entrypoint-wrapper.sh /docker-entrypoint-wrapper.sh
docker-entrypoint-wrapper.sh CHANGED
@@ -46,10 +46,24 @@ done
46
  # Update DATABASE_URL to use TCP connection instead of Unix socket
47
  export DATABASE_URL="postgresql://postgres:postgres@localhost:5432/node"
48
 
 
 
 
 
 
 
 
 
49
  # Set NEXTAUTH_URL based on SPACE_ID if available
50
- if [ -n "$SPACE_HOST" ]; then
51
- export NEXTAUTH_URL="https://${SPACE_HOST}"
 
 
 
52
  fi
53
 
 
 
 
54
  # Run the original entrypoint script
55
- ./web/entrypoint.sh node ./web/server.js --keepAliveTimeout 110000
 
46
  # Update DATABASE_URL to use TCP connection instead of Unix socket
47
  export DATABASE_URL="postgresql://postgres:postgres@localhost:5432/node"
48
 
49
+ # Debug network information
50
+ echo "Network Debug Information:"
51
+ echo "-------------------------"
52
+ ip addr show
53
+ echo "-------------------------"
54
+ netstat -tulpn
55
+ echo "-------------------------"
56
+
57
  # Set NEXTAUTH_URL based on SPACE_ID if available
58
+ if [ -n "$SPACE_ID" ]; then
59
+ echo "Setting NEXTAUTH_URL to https://${SPACE_ID}.hf.space"
60
+ export NEXTAUTH_URL="https://${SPACE_ID}.hf.space"
61
+ else
62
+ echo "WARNING: SPACE_ID not found"
63
  fi
64
 
65
+ # Maybe we need to bind to 0.0.0.0 explicitly
66
+ export HOSTNAME="0.0.0.0"
67
+
68
  # Run the original entrypoint script
69
+ ./web/entrypoint.sh node ./web/server.js --keepAliveTimeout 110000 --hostname 0.0.0.0