Skip to content

Commit 25dced5

Browse files
authored
Merge pull request #49 from bbglab/dev/containers-recipes
feat: add Dockerfile for building and installing openvariant
2 parents 271ee6e + be184ab commit 25dced5

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

Dockerfile

Lines changed: 32 additions & 0 deletions
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

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ pip install open-variant
6464

6565
For more details check our [Installation](https://openvariant.readthedocs.io/en/latest/installation.html) section.
6666

67+
### Running with Docker
68+
69+
You can quickly build and run OpenVariant using [Dockerfile](./Dockerfile) without installing dependencies locally:
70+
71+
```bash
72+
docker build -t openvariant .
73+
docker run --rm openvariant openvar --help
74+
```
75+
6776
## Examples
6877

6978
We provide a variety of [examples](https://github.com/bbglab/openvariant/tree/master/examples) to help to understand how OpenVariant can be applied. Explore the

0 commit comments

Comments
 (0)