Spaces:
Sleeping
Sleeping
Merge pull request #8 from gvatsal60/gvatsal60-patch-1
Browse files- Dockerfile +6 -21
Dockerfile
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
# File: Dockerfile
|
| 3 |
# Author: Vatsal Gupta (gvatsal60)
|
| 4 |
# Date: 21-Sep-2025
|
| 5 |
-
# Description: Dockerfile for a Streamlit application
|
| 6 |
# ##########################################################################
|
| 7 |
|
| 8 |
# ##########################################################################
|
|
@@ -15,8 +15,7 @@
|
|
| 15 |
# ##########################################################################
|
| 16 |
# Base Image
|
| 17 |
# ##########################################################################
|
| 18 |
-
|
| 19 |
-
FROM python:3.12-slim AS builder
|
| 20 |
|
| 21 |
# ##########################################################################
|
| 22 |
# Maintainer
|
|
@@ -31,24 +30,10 @@ WORKDIR /app
|
|
| 31 |
# ##########################################################################
|
| 32 |
# Copy Files
|
| 33 |
# ##########################################################################
|
| 34 |
-
|
| 35 |
-
COPY requirements.txt .
|
| 36 |
-
RUN pip install --user --no-cache-dir -r requirements.txt
|
| 37 |
|
| 38 |
-
|
| 39 |
-
COPY src/ .
|
| 40 |
-
|
| 41 |
-
# Stage 2: Runtime - Create the distroless image
|
| 42 |
-
FROM gcr.io/distroless/python3-debian12:nonroot
|
| 43 |
-
|
| 44 |
-
WORKDIR /app
|
| 45 |
-
|
| 46 |
-
# Copy installed packages and application code from the builder stage
|
| 47 |
-
COPY --from=builder /root/.local /usr/.local
|
| 48 |
-
COPY --from=builder /app .
|
| 49 |
-
|
| 50 |
-
# Add the user's local bin directory to the PATH
|
| 51 |
-
ENV PATH=/usr/.local/bin:$PATH
|
| 52 |
|
| 53 |
# ##########################################################################
|
| 54 |
# Expose Port
|
|
@@ -58,4 +43,4 @@ EXPOSE 8501
|
|
| 58 |
# ##########################################################################
|
| 59 |
# Command to Run
|
| 60 |
# ##########################################################################
|
| 61 |
-
|
|
|
|
| 2 |
# File: Dockerfile
|
| 3 |
# Author: Vatsal Gupta (gvatsal60)
|
| 4 |
# Date: 21-Sep-2025
|
| 5 |
+
# Description: Dockerfile for a Streamlit application.
|
| 6 |
# ##########################################################################
|
| 7 |
|
| 8 |
# ##########################################################################
|
|
|
|
| 15 |
# ##########################################################################
|
| 16 |
# Base Image
|
| 17 |
# ##########################################################################
|
| 18 |
+
FROM python:3.12-alpine
|
|
|
|
| 19 |
|
| 20 |
# ##########################################################################
|
| 21 |
# Maintainer
|
|
|
|
| 30 |
# ##########################################################################
|
| 31 |
# Copy Files
|
| 32 |
# ##########################################################################
|
| 33 |
+
COPY src/ ./src/
|
| 34 |
+
COPY requirements.txt ./
|
|
|
|
| 35 |
|
| 36 |
+
RUN pip3 install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
# ##########################################################################
|
| 39 |
# Expose Port
|
|
|
|
| 43 |
# ##########################################################################
|
| 44 |
# Command to Run
|
| 45 |
# ##########################################################################
|
| 46 |
+
ENTRYPOINT ["streamlit", "run", "src/app.py", "--server.port=8501", "--server.address=0.0.0.0", "--browser.gatherUsageStats=false"]
|