RoyAalekh commited on
Commit
2fbf7a6
·
1 Parent(s): c42e7b6

Configure virtual environment and Python path in Dockerfile

Browse files

Added environment variables for virtual environment and Python path.

Files changed (1) hide show
  1. Dockerfile +13 -7
Dockerfile CHANGED
@@ -7,31 +7,37 @@ RUN apt-get update \
7
 
8
  WORKDIR /app
9
 
 
 
 
10
  # Install uv
11
  RUN curl -LsSf https://astral.sh/uv/install.sh | sh
12
  ENV PATH="/root/.local/bin:${PATH}"
13
 
14
- # Create uv venv
15
  RUN uv venv /app/.venv
 
16
  ENV VIRTUAL_ENV=/app/.venv
17
  ENV PATH="/app/.venv/bin:${PATH}"
18
 
 
 
 
19
  # Copy project
20
  COPY . .
21
 
22
- # IMPORTANT: ensure scheduler/ is importable ALWAYS
23
- ENV PYTHONPATH="/app"
24
-
25
- # Install dependencies inside venv
26
  RUN uv pip install --upgrade pip setuptools wheel \
27
  && uv pip install .
28
 
29
- # Sanity check
30
  RUN uv --version \
31
  && python --version \
 
 
 
32
  && pip list
33
 
34
  EXPOSE 8501
35
 
36
  CMD ["/app/.venv/bin/streamlit", "run", "scheduler/dashboard/app.py", "--server.port=8501", "--server.address=0.0.0.0"]
37
-
 
7
 
8
  WORKDIR /app
9
 
10
+ # Tell uv to ALWAYS use /app/.venv instead of creating temp envs
11
+ ENV UV_PROJECT_ENVIRONMENT=/app/.venv
12
+
13
  # Install uv
14
  RUN curl -LsSf https://astral.sh/uv/install.sh | sh
15
  ENV PATH="/root/.local/bin:${PATH}"
16
 
17
+ # Create virtual env
18
  RUN uv venv /app/.venv
19
+
20
  ENV VIRTUAL_ENV=/app/.venv
21
  ENV PATH="/app/.venv/bin:${PATH}"
22
 
23
+ # Ensure scheduler is always importable
24
+ ENV PYTHONPATH="/app"
25
+
26
  # Copy project
27
  COPY . .
28
 
29
+ # Install deps
 
 
 
30
  RUN uv pip install --upgrade pip setuptools wheel \
31
  && uv pip install .
32
 
33
+ # Diagnostics
34
  RUN uv --version \
35
  && python --version \
36
+ && which court-scheduler \
37
+ && which python \
38
+ && which streamlit \
39
  && pip list
40
 
41
  EXPOSE 8501
42
 
43
  CMD ["/app/.venv/bin/streamlit", "run", "scheduler/dashboard/app.py", "--server.port=8501", "--server.address=0.0.0.0"]