-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (32 loc) · 1.17 KB
/
Dockerfile
File metadata and controls
41 lines (32 loc) · 1.17 KB
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
37
38
39
40
41
#------------Dockerfile1 with pip------
## base Docker image that we will build on
#FROM python:3.13.11-slim
#
## set up our image by installing prerequisites; pandas in this case
#RUN pip install pandas pyarrow
#
## set up the working directory inside the container
#WORKDIR /app
## copy the script to the container. 1st name is source file, 2nd is destination
#COPY pipeline.py pipeline.py
#
## define what to do first when the container runs
## in this example, we will just run the script
#ENTRYPOINT ["python", "pipeline.py"]
#-----------------Dockerfile 2 with uv-------
# Start with slim Python 3.13 image
FROM python:3.13.10-slim
# Copy uv binary from official uv image (multi-stage build pattern)
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/
# Set working directory
WORKDIR /app
# Add virtual environment to PATH so we can use installed packages
ENV PATH="/app/.venv/bin:$PATH"
# Copy dependency files first (better layer caching)
COPY "pyproject.toml" "uv.lock" ".python-version" ./
# Install dependencies from lock file (ensures reproducible builds)
RUN uv sync --locked
# Copy application code
COPY pipeline.py pipeline.py
# Set entry point
ENTRYPOINT ["python", "pipeline.py"]