thera-guide-ai / Dockerfile
Said Lfagrouche
Prepare for Hugging Face Spaces deployment with simplified configuration
542933f
raw
history blame
1.03 kB
FROM python:3.9
WORKDIR /app
# Install git, git-lfs, and build dependencies for native extensions
RUN apt-get update && \
apt-get install -y git git-lfs build-essential cmake pkg-config libpq-dev gcc g++ && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Copy requirements file
COPY requirements.txt .
# Install dependencies with pip upgrade
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir --upgrade -r requirements.txt
# Create necessary directories with proper permissions
RUN mkdir -p data/users data/sessions data/conversations data/feedback && \
mkdir -p mental_health_model_artifacts/chroma_db && \
mkdir -p nltk_data && \
chmod -R 777 data nltk_data mental_health_model_artifacts
# Copy application files
COPY app.py .
COPY .env.example .env
COPY api_mental_health.py .
COPY run_api.sh .
# Make the script executable
RUN chmod +x run_api.sh
# Expose the port Hugging Face Spaces expects
EXPOSE 7860
# Command to run the application
CMD ["./run_api.sh"]