-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
36 lines (26 loc) · 1.02 KB
/
Dockerfile
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
32
33
34
35
36
# Use the official Python image as the base image
FROM python:3.13.1-slim
# Set environment variables to prevent Python from writing .pyc files and buffering stdout
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
POETRY_VERSION=1.6.1
# Install system dependencies required by Poetry and Streamlit
RUN apt-get update && apt-get install -y --no-install-recommends \
curl build-essential && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Install Poetry package manager
RUN curl -sSL https://install.python-poetry.org | python3 -
# Add Poetry to PATH
ENV PATH="/root/.local/bin:$PATH"
# Set the working directory inside the container
WORKDIR /app
# Copy the pyproject.toml and poetry.lock files
COPY pyproject.toml poetry.lock ./
# Install dependencies using Poetry
RUN poetry install --no-root --no-dev
# Copy the entire project into the working directory
COPY . .
# Expose the default Streamlit port
EXPOSE 8501
# Set the entrypoint command to run Streamlit
CMD ["poetry", "run", "streamlit", "run", "app/main.py"]