akhil-vaidya commited on
Commit
5ad3d90
·
verified ·
1 Parent(s): 9dfd1dd

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +56 -40
Dockerfile CHANGED
@@ -1,40 +1,56 @@
1
- # Dockerfile for QualiVec Streamlit Demo
2
-
3
- # 1. Base Image
4
- FROM python:3.12-slim
5
-
6
- # 2. Set the working directory
7
- WORKDIR /app
8
-
9
- # 3. Install system dependencies
10
- RUN apt-get update && apt-get install -y \
11
- build-essential \
12
- curl \
13
- && rm -rf /var/lib/apt/lists/*
14
-
15
- # 4. Install uv - the fast Python package manager
16
- RUN pip install --no-cache-dir uv
17
-
18
- # 5. Copy dependency definition files and README (required for package build)
19
- COPY pyproject.toml uv.lock README.md ./
20
-
21
- # 6. Copy source code (needed for package installation)
22
- COPY src/ ./src/
23
-
24
- # 7. Install Python dependencies using uv
25
- # 'uv pip install .' reads pyproject.toml and installs the project dependencies
26
- RUN uv pip install --system --no-cache-dir .
27
-
28
- # 8. Copy the rest of the application source code
29
- # Make sure you have a .dockerignore file to exclude .venv
30
- COPY . .
31
-
32
- # 9. Expose the port Streamlit runs on
33
- EXPOSE 8501
34
-
35
- # 10. Add a health check to verify the app is running
36
- HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
37
-
38
- # 11. Define the entry point to use the run_demo.py script via uv
39
- # ENTRYPOINT ["uv", "run", "app/run_demo.py"]
40
- ENTRYPOINT ["python", "app/run_demo.py"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ============================
2
+ # Base Image
3
+ # ============================
4
+ FROM python:3.12-slim
5
+
6
+ # ============================
7
+ # Working directory
8
+ # ============================
9
+ WORKDIR /app
10
+
11
+ # ============================
12
+ # System dependencies
13
+ # ============================
14
+ RUN apt-get update && apt-get install -y \
15
+ build-essential \
16
+ curl \
17
+ && rm -rf /var/lib/apt/lists/*
18
+
19
+ # ============================
20
+ # Copy dependency metadata
21
+ # ============================
22
+
23
+ COPY pyproject.toml uv.lock ./
24
+
25
+ # ============================
26
+ # Install third-party dependencies ONLY
27
+ # (no project installation)
28
+ # ============================
29
+ COPY requirements.txt .
30
+ RUN pip install --no-cache-dir -r requirements.txt
31
+
32
+ # ============================
33
+ # Copy source code
34
+ # ============================
35
+ COPY src/ ./src/
36
+ COPY app/ ./app/
37
+
38
+ # ============================
39
+ # Make src discoverable
40
+ # ============================
41
+ ENV PYTHONPATH=/app/src
42
+
43
+ # ============================
44
+ # Expose Streamlit port
45
+ # ============================
46
+ EXPOSE 8501
47
+
48
+ # ============================
49
+ # Health check
50
+ # ============================
51
+ HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
52
+
53
+ # ============================
54
+ # Run the demo
55
+ # ============================
56
+ ENTRYPOINT ["python", "app/run_demo.py"]