-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
46 lines (36 loc) · 1.15 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Use an official Python runtime as a parent image
FROM python:3.9-slim
# Set the working directory in the container
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
curl \
software-properties-common \
&& rm -rf /var/lib/apt/lists/*
# Copy the requirements file into the container
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the application code
COPY app.py .
COPY app_tools.py .
# Expose the port Streamlit will run on
EXPOSE 8501
# Create a non-root user
RUN useradd -m myuser
USER myuser
# Set environment variables for Streamlit
ENV STREAMLIT_SERVER_PORT=8501
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
# Command to run the Streamlit app
CMD ["streamlit", "run", "app.py"]
##################################################
# TO BUILD THE DOCKERFILE :
# docker build -t mongodb-rag-app .
# docker run -p 8501:8501 \
# -e GROQ_API_KEY=your_groq_api_key \
# -e COHERE_DEV_API=your_cohere_api_key \
# -e MONGO_URI=your_mongodb_connection_string \
# mongodb-rag-app
##################################################