alexandraroze commited on
Commit
b5a4b96
·
1 Parent(s): a3db5d7

updated docker

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -6
Dockerfile CHANGED
@@ -1,11 +1,13 @@
1
  FROM nvidia/cuda:12.1.1-devel-ubuntu22.04
2
 
3
- # System-level environment variables
4
  ENV HOST 0.0.0.0
5
  ENV HOME /home/user
6
  ENV PATH $HOME/.local/bin:$PATH
 
 
7
 
8
- # Install system dependencies for Python and build tools
9
  RUN apt-get update && apt-get install -y \
10
  python3 python3-pip build-essential git \
11
  && rm -rf /var/lib/apt/lists/*
@@ -17,12 +19,12 @@ RUN useradd -m -u 1000 user
17
  RUN pip install --no-cache-dir --upgrade pip \
18
  && pip install --no-cache-dir poetry
19
 
 
 
 
20
  # Switch to non-root user
21
  USER user
22
 
23
- # Ensure Poetry works for non-root user
24
- ENV POETRY_CACHE_DIR=/home/user/.cache/pypoetry
25
-
26
  # Set the working directory
27
  WORKDIR /home/user/app
28
 
@@ -40,4 +42,4 @@ COPY --chown=user . /home/user/app
40
  EXPOSE 8501
41
 
42
  # Run the Streamlit app
43
- CMD ["streamlit", "run", "app.py", "--server.headless=true", "--server.enableCORS=false", "--server.enableXsrfProtection=false", "--server.fileWatcherType=none"]
 
1
  FROM nvidia/cuda:12.1.1-devel-ubuntu22.04
2
 
3
+ # Set environment variables
4
  ENV HOST 0.0.0.0
5
  ENV HOME /home/user
6
  ENV PATH $HOME/.local/bin:$PATH
7
+ ENV POETRY_CACHE_DIR=/home/user/.cache/pypoetry
8
+ ENV TMPDIR=/home/user/tmp
9
 
10
+ # Install system dependencies
11
  RUN apt-get update && apt-get install -y \
12
  python3 python3-pip build-essential git \
13
  && rm -rf /var/lib/apt/lists/*
 
19
  RUN pip install --no-cache-dir --upgrade pip \
20
  && pip install --no-cache-dir poetry
21
 
22
+ # Create temporary and cache directories for Poetry
23
+ RUN mkdir -p /home/user/tmp && chown -R user:user /home/user/tmp
24
+
25
  # Switch to non-root user
26
  USER user
27
 
 
 
 
28
  # Set the working directory
29
  WORKDIR /home/user/app
30
 
 
42
  EXPOSE 8501
43
 
44
  # Run the Streamlit app
45
+ CMD ["streamlit", "run", "app.py", "--server.headless=true", "--server.enableCORS=false", "--server.enableXsrfProtection=false", "--server.fileWatcherType=none"]