Skip to content

Commit df77025

Browse files
feat: add Dockerfile for building and installing openvariant
1 parent 271ee6e commit df77025

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Dockerfile

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM ghcr.io/astral-sh/uv:0.5-python3.13-bookworm AS build-stage
2+
3+
# Set environment variables
4+
ENV UV_COMPILE_BYTECODE=1
5+
6+
# Set the working directory to /openvariant
7+
WORKDIR /openvariant
8+
9+
# Stage necessary files into the container
10+
COPY uv.lock uv.lock
11+
COPY pyproject.toml pyproject.toml
12+
COPY openvariant openvariant
13+
COPY LICENSE LICENSE
14+
COPY README.md README.md
15+
16+
# Install dependencies and build the project
17+
RUN mkdir -p /root/.cache/uv \
18+
&& uv sync --frozen --no-dev \
19+
&& uv build
20+
21+
# Second stage: Runtime image
22+
FROM python:3.13-bookworm AS runtime-stage
23+
24+
# Copy openvariant from the build stage
25+
COPY --from=build-stage /openvariant/dist /openvariant/dist
26+
WORKDIR /openvariant
27+
28+
# Install openvariant
29+
RUN pip install dist/*.tar.gz
30+
31+
# Test the installation
32+
RUN openvar --help

0 commit comments

Comments
 (0)