LogicGoInfotechSpaces commited on
Commit
e314d38
·
1 Parent(s): 4cd67d1

Make Firebase credentials writing non-fatal in entrypoint

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -3
Dockerfile CHANGED
@@ -30,11 +30,11 @@ RUN mkdir -p /data/uploads /data/results
30
  # Handle Firebase credentials from environment variable (for Hugging Face Spaces secrets)
31
  # This allows the credentials to be passed as a secret and written to file at runtime
32
  # Note: Python code will create /data/hf_cache with proper permissions
 
33
  RUN echo '#!/bin/sh' > /entrypoint.sh && \
34
- echo 'set -e' >> /entrypoint.sh && \
35
- echo 'mkdir -p /data/uploads /data/results' >> /entrypoint.sh && \
36
  echo 'if [ -n "$FIREBASE_CREDENTIALS" ]; then' >> /entrypoint.sh && \
37
- echo ' printf "%s" "$FIREBASE_CREDENTIALS" > /data/firebase-adminsdk.json' >> /entrypoint.sh && \
38
  echo 'fi' >> /entrypoint.sh && \
39
  echo 'exec "$@"' >> /entrypoint.sh && \
40
  chmod +x /entrypoint.sh
 
30
  # Handle Firebase credentials from environment variable (for Hugging Face Spaces secrets)
31
  # This allows the credentials to be passed as a secret and written to file at runtime
32
  # Note: Python code will create /data/hf_cache with proper permissions
33
+ # Make Firebase credentials writing non-fatal (use || true to continue on error)
34
  RUN echo '#!/bin/sh' > /entrypoint.sh && \
35
+ echo 'mkdir -p /data/uploads /data/results || true' >> /entrypoint.sh && \
 
36
  echo 'if [ -n "$FIREBASE_CREDENTIALS" ]; then' >> /entrypoint.sh && \
37
+ echo ' printf "%s" "$FIREBASE_CREDENTIALS" > /data/firebase-adminsdk.json 2>/dev/null || true' >> /entrypoint.sh && \
38
  echo 'fi' >> /entrypoint.sh && \
39
  echo 'exec "$@"' >> /entrypoint.sh && \
40
  chmod +x /entrypoint.sh