Harsh-P/knowledge_graph
0
1# Use official Python image2FROM python:3.11.93 4### Step 1: Set up a new user with proper permissions5RUN useradd -m -u 1000 user6 7# Switch to the new user8USER user9 10# Set up environment variables for the user11ENV HOME=/home/user \12 PATH=/home/user/.local/bin:$PATH13 14# Set working directory15WORKDIR $HOME/app16 17# Copy the app files and set ownership to the new user18COPY --chown=user . $HOME/app19 20### Step 2: Install dependencies21COPY requirements.txt requirements.txt22RUN pip install --no-cache-dir -r requirements.txt23 24# Copy all project files25COPY . .26 27 28### Step 3: Fix permissions29USER root30RUN chmod -R 777 $HOME/app \31 && apt-get update \32 && apt-get install -y ffmpeg \33 && apt-get clean34# Copy entrypoint script and set execute permissions35# COPY entrypoint.sh /home/user/app/entrypoint.sh36# RUN chmod +x /home/user/app/entrypoint.sh37USER user # Switch back to non-root user38 39# Expose Flask (7860) and Streamlit (8501) ports40EXPOSE 786041 42 43 44# Run both Flask API & Streamlit App45#CMD ["./entrypoint.sh"]46#CMD ["sh", "-c", "gunicorn -w 1 -b 0.0.0.0:5000 app:app & streamlit run streamlit_app.py --server.port=7860 --server.address=0.0.0.0"]47CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]