Skip to content

feat: add Dockerfile for building and installing openvariant #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM ghcr.io/astral-sh/uv:0.5-python3.13-bookworm AS build-stage

# Set environment variables
ENV UV_COMPILE_BYTECODE=1

# Set the working directory to /openvariant
WORKDIR /openvariant

# Stage necessary files into the container
COPY uv.lock uv.lock
COPY pyproject.toml pyproject.toml
COPY openvariant openvariant
COPY LICENSE LICENSE
COPY README.md README.md

# Install dependencies and build the project
RUN mkdir -p /root/.cache/uv \
&& uv sync --frozen --no-dev \
&& uv build

# Second stage: Runtime image
FROM python:3.13-bookworm AS runtime-stage

# Copy openvariant from the build stage
COPY --from=build-stage /openvariant/dist /openvariant/dist
WORKDIR /openvariant

# Install openvariant
RUN pip install dist/*.tar.gz

# Test the installation
RUN openvar --help
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ pip install open-variant

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

### Running with Docker

You can quickly build and run OpenVariant using [Dockerfile](./Dockerfile) without installing dependencies locally:

```bash
docker build -t openvariant .
docker run --rm openvariant openvar --help
```

## Examples

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
Expand Down