Said Lfagrouche commited on
Commit
542933f
·
1 Parent(s): e62f11c

Prepare for Hugging Face Spaces deployment with simplified configuration

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -7
Dockerfile CHANGED
@@ -15,20 +15,23 @@ COPY requirements.txt .
15
  RUN pip install --no-cache-dir --upgrade pip && \
16
  pip install --no-cache-dir --upgrade -r requirements.txt
17
 
18
- # Download NLTK data
19
- RUN python -c "import nltk; nltk.download('punkt'); nltk.download('wordnet'); nltk.download('stopwords')"
20
-
21
- # Create necessary directories
22
- RUN mkdir -p data/users data/sessions data/conversations data/feedback
23
- RUN mkdir -p mental_health_model_artifacts/chroma_db
24
 
25
  # Copy application files
26
  COPY app.py .
27
  COPY .env.example .env
28
  COPY api_mental_health.py .
 
 
 
 
29
 
30
  # Expose the port Hugging Face Spaces expects
31
  EXPOSE 7860
32
 
33
  # Command to run the application
34
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
15
  RUN pip install --no-cache-dir --upgrade pip && \
16
  pip install --no-cache-dir --upgrade -r requirements.txt
17
 
18
+ # Create necessary directories with proper permissions
19
+ RUN mkdir -p data/users data/sessions data/conversations data/feedback && \
20
+ mkdir -p mental_health_model_artifacts/chroma_db && \
21
+ mkdir -p nltk_data && \
22
+ chmod -R 777 data nltk_data mental_health_model_artifacts
 
23
 
24
  # Copy application files
25
  COPY app.py .
26
  COPY .env.example .env
27
  COPY api_mental_health.py .
28
+ COPY run_api.sh .
29
+
30
+ # Make the script executable
31
+ RUN chmod +x run_api.sh
32
 
33
  # Expose the port Hugging Face Spaces expects
34
  EXPOSE 7860
35
 
36
  # Command to run the application
37
+ CMD ["./run_api.sh"]