Skip to content

Commit a10173c

Browse files
add initial docker image
1 parent a1ece7c commit a10173c

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# from https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers
2+
3+
# Install uv
4+
FROM python:3.12-slim
5+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
6+
7+
# Change the working directory to the `app` directory
8+
WORKDIR /app
9+
10+
# Install dependencies
11+
RUN --mount=type=cache,target=/root/.cache/uv \
12+
--mount=type=bind,source=uv.lock,target=uv.lock \
13+
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
14+
uv sync --frozen --no-install-project
15+
16+
# Copy the project into the image
17+
ADD . /app
18+
19+
# Sync the project
20+
RUN --mount=type=cache,target=/root/.cache/uv \
21+
uv sync --frozen
22+
23+
ENTRYPOINT [ "uv", "run", "inferadmin" ]

compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
services:
2+
inferadmin:
3+
build: .
4+
ports:
5+
- "8000:8000"
6+
volumes:
7+
- /var/run/docker.sock:/var/run/docker.sock
8+
env_file:
9+
- .env
10+
deploy:
11+
resources:
12+
reservations:
13+
devices:
14+
- capabilities: [gpu]

0 commit comments

Comments
 (0)