-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (25 loc) · 844 Bytes
/
Dockerfile
File metadata and controls
34 lines (25 loc) · 844 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
32
33
34
# Use Python 3.13 as the base image
FROM python:3.13-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install Poetry
ENV POETRY_HOME=/opt/poetry \
POETRY_VIRTUALENVS_CREATE=false
RUN curl -sSL https://install.python-poetry.org | python3 -
# Add Poetry to PATH
ENV PATH="$POETRY_HOME/bin:$PATH"
# Set working directory
WORKDIR /app
# Copy only the dependency files first to leverage Docker cache
COPY pyproject.toml poetry.lock* ./
# Install project dependencies
RUN poetry install --no-interaction --no-ansi --no-root
# Copy the rest of the application
COPY . .
# Set the entrypoint to run main.py
ENTRYPOINT ["poetry", "run", "python", "main.py"]