RoyAalekh commited on
Commit
93bc38b
·
1 Parent(s): 358c4f1

Refactor Dockerfile to use uv for virtual environment

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -19
Dockerfile CHANGED
@@ -7,30 +7,27 @@ RUN apt-get update \
7
 
8
  WORKDIR /app
9
 
10
- ENV PYTHONDONTWRITEBYTECODE=1 \
11
- PYTHONUNBUFFERED=1 \
12
- PIP_NO_CACHE_DIR=1 \
13
- PIP_DISABLE_PIP_VERSION_CHECK=1 \
14
- PYTHONPATH=/app
15
 
16
- COPY . .
 
17
 
18
- RUN pip install --upgrade pip setuptools wheel \
19
- && pip install .
20
 
21
- # Install uv
22
- RUN curl -LsSf https://astral.sh/uv/install.sh | sh
23
 
24
- # Move uv from /root/.local/bin to /usr/local/bin
25
- # so Render's non-root user can access it
26
- RUN cp /root/.local/bin/uv /usr/local/bin/uv
27
- ENV PATH="/usr/local/bin:${PATH}"
28
 
29
- # Verify
30
- RUN uv --version
31
 
32
- # Streamlit default
33
- EXPOSE 8501
 
 
 
34
 
35
- CMD ["streamlit", "run", "scheduler/dashboard/app.py", "--server.port=8501", "--server.address=0.0.0.0"]
36
 
 
 
7
 
8
  WORKDIR /app
9
 
10
+ RUN curl -LsSf https://astral.sh/uv/install.sh | sh
 
 
 
 
11
 
12
+ # MAKE SURE uv is globally visible
13
+ ENV PATH="/root/.local/bin:${PATH}"
14
 
15
+ RUN uv venv /app/.venv
 
16
 
17
+ ENV VIRTUAL_ENV=/app/.venv
18
+ ENV PATH="/app/.venv/bin:${PATH}"
19
 
20
+ COPY . .
 
 
 
21
 
22
+ RUN uv pip install --upgrade pip setuptools wheel \
23
+ && uv pip install .
24
 
25
+ RUN uv --version \
26
+ && which uv \
27
+ && which python \
28
+ && python --version \
29
+ && which streamlit
30
 
31
+ EXPOSE 8501
32
 
33
+ CMD ["/app/.venv/bin/streamlit", "run", "scheduler/dashboard/app.py", "--server.port=8501", "--server.address=0.0.0.0"]