Skip to content

Commit c49c6ed

Browse files
committed
add dockerfile
1 parent 1948cd6 commit c49c6ed

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.venv
2+
uv.lock

Dockerfile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
2+
3+
WORKDIR /app
4+
5+
# Combine apt installs to reduce layers
6+
RUN apt-get update && apt-get install -y --no-install-recommends\
7+
libglib2.0-0 \
8+
libgl1-mesa-glx \
9+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
10+
11+
COPY pyproject.toml ./
12+
13+
COPY . .
14+
15+
# Install dependencies
16+
RUN uv sync --no-dev
17+

pyproject.toml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[project]
2+
name = "uv_torch"
3+
version = "0.0.1"
4+
description = "A vase image for uv and pytorch"
5+
authors = [{ name = "Restack Team", email = "[email protected]" }]
6+
requires-python = ">=3.12,<4.0"
7+
readme = "README.md"
8+
dependencies = [
9+
"python-multipart==0.0.19",
10+
"numpy==2.2.0",
11+
"pillow==11.0.0",
12+
"python-doctr[torch]==0.10.0",
13+
"requests==2.32.3"
14+
]
15+
16+
[build-system]
17+
requires = ["hatchling"]
18+
build-backend = "hatchling.build"
19+
20+
[tool.uv.sources]
21+
torch = [
22+
{ index = "pytorch-cpu" },
23+
]
24+
torchvision = [
25+
{ index = "pytorch-cpu" },
26+
]
27+
28+
[[tool.uv.index]]
29+
name = "pytorch-cpu"
30+
url = "https://download.pytorch.org/whl/cpu"
31+
explicit = true
32+
33+
[tool.hatch.build.targets.sdist]
34+
include = ["src"]
35+
36+
[tool.hatch.build.targets.wheel]
37+
include = ["src"]

0 commit comments

Comments
 (0)