Update Dockerfile
Browse files- Dockerfile +37 -36
Dockerfile
CHANGED
|
@@ -1,37 +1,38 @@
|
|
| 1 |
-
# Use Python 3.13 slim image as base
|
| 2 |
-
FROM python:3.13.2-slim
|
| 3 |
-
|
| 4 |
-
# Set working directory
|
| 5 |
-
WORKDIR /app
|
| 6 |
-
|
| 7 |
-
# Set environment variables
|
| 8 |
-
ENV PYTHONDONTWRITEBYTECODE=1 \
|
| 9 |
-
PYTHONUNBUFFERED=1 \
|
| 10 |
-
STREAMLIT_SERVER_PORT=8501 \
|
| 11 |
-
STREAMLIT_SERVER_ADDRESS=0.0.0.0 \
|
| 12 |
-
UV_CACHE_DIR=/tmp/uv-cache
|
| 13 |
-
|
| 14 |
-
# Install system dependencies and uv
|
| 15 |
-
RUN apt-get update && apt-get install -y \
|
| 16 |
-
build-essential \
|
| 17 |
-
curl \
|
| 18 |
-
&& rm -rf /var/lib/apt/lists/* \
|
| 19 |
-
&& curl -LsSf https://astral.sh/uv/install.sh | sh
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
|
|
|
| 37 |
CMD ["uv", "run", "streamlit", "run", "app.py"]
|
|
|
|
| 1 |
+
# Use Python 3.13 slim image as base
|
| 2 |
+
FROM python:3.13.2-slim
|
| 3 |
+
|
| 4 |
+
# Set working directory
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Set environment variables
|
| 8 |
+
ENV PYTHONDONTWRITEBYTECODE=1 \
|
| 9 |
+
PYTHONUNBUFFERED=1 \
|
| 10 |
+
STREAMLIT_SERVER_PORT=8501 \
|
| 11 |
+
STREAMLIT_SERVER_ADDRESS=0.0.0.0 \
|
| 12 |
+
UV_CACHE_DIR=/tmp/uv-cache
|
| 13 |
+
|
| 14 |
+
# Install system dependencies and uv
|
| 15 |
+
RUN apt-get update && apt-get install -y \
|
| 16 |
+
build-essential \
|
| 17 |
+
curl \
|
| 18 |
+
&& rm -rf /var/lib/apt/lists/* \
|
| 19 |
+
&& curl -LsSf https://astral.sh/uv/install.sh | sh \
|
| 20 |
+
&& /root/.cargo/bin/uv --version
|
| 21 |
+
|
| 22 |
+
# Add uv to PATH
|
| 23 |
+
ENV PATH="/root/.cargo/bin:$PATH"
|
| 24 |
+
|
| 25 |
+
# Copy project files
|
| 26 |
+
COPY pyproject.toml uv.lock* ./
|
| 27 |
+
|
| 28 |
+
# Install dependencies using uv with full path to ensure it's found
|
| 29 |
+
RUN /root/.cargo/bin/uv sync --frozen --no-dev
|
| 30 |
+
|
| 31 |
+
# Copy the rest of the application
|
| 32 |
+
COPY . .
|
| 33 |
+
|
| 34 |
+
# Expose the port Streamlit runs on
|
| 35 |
+
EXPOSE 8501
|
| 36 |
+
|
| 37 |
+
# Command to run the application using uv
|
| 38 |
CMD ["uv", "run", "streamlit", "run", "app.py"]
|