SRA25 commited on
Commit
5a638a4
·
verified ·
1 Parent(s): 5a218ec

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -8
Dockerfile CHANGED
@@ -1,18 +1,16 @@
1
  FROM python:3.13.5-slim
2
 
3
- WORKDIR /app
4
-
5
  RUN apt-get update && apt-get install -y \
6
  build-essential \
7
  curl \
8
  git \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- COPY requirements.txt ./
12
- COPY src/ ./src/
13
- COPY database_telemetry.db ./src/
14
- COPY langgraph_init.py ./src/
15
- COPY config.py ./src/
16
  # COPY config.py ./src/
17
 
18
  # ✅ Prevent Streamlit from writing to root
@@ -22,7 +20,22 @@ ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
22
  # Hugging Face cache paths (redirect to /tmp)
23
  ENV HF_HOME=/tmp/huggingface
24
 
25
- RUN pip3 install -r requirements.txt
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
 
27
  EXPOSE 8501
28
 
 
1
  FROM python:3.13.5-slim
2
 
 
 
3
  RUN apt-get update && apt-get install -y \
4
  build-essential \
5
  curl \
6
  git \
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
+ # COPY requirements.txt ./
10
+ # COPY src/ ./src/
11
+ # COPY database_telemetry.db ./src/
12
+ # COPY langgraph_init.py ./src/
13
+ # COPY config.py ./src/
14
  # COPY config.py ./src/
15
 
16
  # ✅ Prevent Streamlit from writing to root
 
20
  # Hugging Face cache paths (redirect to /tmp)
21
  ENV HF_HOME=/tmp/huggingface
22
 
23
+ # Set up user and environment
24
+ RUN useradd -m -u 1000 user
25
+ USER user
26
+ ENV HOME=/home/user \
27
+ PATH="/home/user/.local/bin:$PATH"
28
+
29
+ WORKDIR $HOME/app
30
+
31
+ COPY --chown=user requirements.txt .
32
+ COPY --chown=user src/ ./src/
33
+ COPY --chown=user database_telemetry.db ./src/
34
+ COPY --chown=user langgraph_init.py ./src/
35
+ COPY --chown=user config.py ./src/
36
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
37
+
38
+ COPY --chown=user . .
39
 
40
  EXPOSE 8501
41