-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerFile
More file actions
31 lines (22 loc) · 817 Bytes
/
DockerFile
File metadata and controls
31 lines (22 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Use a slim Python image with 3.11 (matching pyproject)
FROM python:3.11-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Install required system tools and build tools
RUN apt-get update && apt-get install -y curl build-essential && rm -rf /var/lib/apt/lists/*
# Install Poetry
RUN curl -sSL https://install.python-poetry.org | python3 -
ENV PATH="/root/.local/bin:$PATH"
# Set workdir
WORKDIR /app
# Copy only dependency files to leverage Docker layer caching
COPY pyproject.toml poetry.lock* /app/
# Install project dependencies (no virtualenv)
RUN poetry config virtualenvs.create false && poetry install --no-root
# Copy the rest of the project
COPY . /app
# Expose Streamlit port
EXPOSE 8501
# Run the Streamlit app
CMD ["streamlit", "run", "src/streamlitApp.py"]