alexandraroze commited on
Commit
852393c
·
1 Parent(s): 22da097

updated docker

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -15
Dockerfile CHANGED
@@ -1,37 +1,40 @@
1
  FROM nvidia/cuda:12.1.1-devel-ubuntu22.04
2
 
 
 
3
  # Install system dependencies for Python and build tools
4
  RUN apt-get update && apt-get install -y \
5
  python3 python3-pip build-essential git
6
 
7
  # Create a non-root user
8
  RUN useradd -m -u 1000 user
9
- ENV PATH="/home/user/.local/bin:$PATH"
10
- ENV POETRY_CACHE_DIR=/home/user/.cache/pypoetry
11
 
12
- # Set the working directory to a writable location
13
- WORKDIR /home/user/app
 
 
14
 
15
- RUN nvcc --version && ls /usr/local/cuda
16
 
17
  # Install Poetry globally as root
18
  RUN pip install --no-cache-dir --upgrade pip \
19
  && pip install --no-cache-dir poetry
20
 
21
- # Switch to non-root user for application setup
22
- USER user
23
 
24
- # Copy Poetry configuration files
25
- COPY --chown=user ./pyproject.toml ./poetry.lock* ./
26
 
27
  # Install dependencies with Poetry
28
  RUN poetry install --only main --no-interaction --no-ansi
29
 
30
- # Copy the rest of the application code
31
- COPY --chown=user . /home/user/app
32
-
33
- # Expose the Streamlit default port
34
- EXPOSE 8501
35
 
36
  # Run the Streamlit app
37
- CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
 
 
 
 
 
1
  FROM nvidia/cuda:12.1.1-devel-ubuntu22.04
2
 
3
+ WORKDIR /app
4
+
5
  # Install system dependencies for Python and build tools
6
  RUN apt-get update && apt-get install -y \
7
  python3 python3-pip build-essential git
8
 
9
  # Create a non-root user
10
  RUN useradd -m -u 1000 user
 
 
11
 
12
+ #ENV POETRY_CACHE_DIR=/home/user/.cache/pypoetry
13
+
14
+ ENV HOME /home/user
15
+ ENV PATH $HOME/.local/bin:$PATH
16
 
 
17
 
18
  # Install Poetry globally as root
19
  RUN pip install --no-cache-dir --upgrade pip \
20
  && pip install --no-cache-dir poetry
21
 
 
 
22
 
23
+ USER user
24
+ COPY ./pyproject.toml ./poetry.lock* ./
25
 
26
  # Install dependencies with Poetry
27
  RUN poetry install --only main --no-interaction --no-ansi
28
 
29
+ WORKDIR $HOME
30
+ RUN mkdir app
31
+ WORKDIR $HOME/app
32
+ COPY . $HOME/app
 
33
 
34
  # Run the Streamlit app
35
+ EXPOSE 8501
36
+ CMD streamlit run app.py \
37
+ --server.headless true \
38
+ --server.enableCORS false \
39
+ --server.enableXsrfProtection false \
40
+ --server.fileWatcherType none