sandbox338 commited on
Commit
61a0315
·
verified ·
1 Parent(s): 34c34d4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -3
Dockerfile CHANGED
@@ -4,9 +4,7 @@ WORKDIR /app
4
 
5
  # Set HOME to a writable location
6
  ENV HOME=/app
7
- ENV MPLCONFIGDIR=/app/.config/matplotlib
8
- ENV TORCH_HOME=/app/.torch
9
- ENV STREAMLIT_HOME=/app/.streamlit
10
 
11
  # Install system dependencies
12
  RUN apt-get update && apt-get install -y \
@@ -24,6 +22,23 @@ RUN apt-get update && apt-get install -y \
24
  libsqlite3-dev \
25
  zlib1g-dev \
26
  && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
  # Create required writable folders
29
  RUN mkdir -p /app/.torch /app/.streamlit /app/.config/matplotlib
 
4
 
5
  # Set HOME to a writable location
6
  ENV HOME=/app
7
+
 
 
8
 
9
  # Install system dependencies
10
  RUN apt-get update && apt-get install -y \
 
22
  libsqlite3-dev \
23
  zlib1g-dev \
24
  && rm -rf /var/lib/apt/lists/*
25
+ # Copy app files
26
+ COPY app.py /app
27
+ COPY requirements.txt /app
28
+
29
+ # Install Python dependencies
30
+ RUN pip install --upgrade pip
31
+ RUN pip install -r requirements.txt
32
+
33
+ # Create writable directories and fix permissions
34
+ RUN mkdir -p /app/.streamlit /app/.torch /tmp/.streamlit && \
35
+ chmod -R 777 /app && \
36
+ chmod -R 777 /tmp
37
+
38
+ # Set environment variables to avoid write permission issues
39
+ ENV TORCH_HOME=/tmp/.torch
40
+ ENV STREAMLIT_HOME=/tmp/.streamlit
41
+ ENV MPLCONFIGDIR=/tmp/mplconfig
42
 
43
  # Create required writable folders
44
  RUN mkdir -p /app/.torch /app/.streamlit /app/.config/matplotlib