Skip to content

Commit f4f3597

Browse files
woodsh17rclune
andauthored
Upload Dockerfile to examples (#222)
* Upload Dockerfile to examples * Update Foundry README with Docker information - There is an image for Foundry on DockerHub - Example recipe is in `foundry/examples/docker` --------- Co-authored-by: Rachel Clune <rachel.clune@omsf.io>
1 parent 3294b06 commit f4f3597

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ foundry list-installed
4141

4242
>*See `examples/all.ipynb` for how to run each model and design proteins end-to-end in a notebook.*
4343
44+
### Docker Image
45+
46+
There is an official [Foundry image](https://hub.docker.com/r/rosettacommons/foundry) maintained by the [Rosetta Commons](https://rosettacommons.org/). The default image comes with the model weights for the available models, but you can use the `slim` tag to either use pre-exiting model weights or use the image to download the available model weights.
47+
48+
For more information and example syntax, see the [Overview on DockerHub](https://hub.docker.com/r/rosettacommons/foundry).
49+
50+
The recipe to create the Docker image can be found in `foundry/examples/docker` and can be used as a "blue-print" for creating your own images.
51+
4452
### Google Colab
4553
For an interactive Google Colab notebook walking through a basic design pipeline with RFD3, MPNN, and RF3, please see the [IPD Design Pipeline Tutorial](https://colab.research.google.com/drive/1ZwIMV3n9h0ZOnIXX0GyKUuoiahgifBxh?usp=sharing).
4654

examples/docker/Dockerfile

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Base image reference:
2+
# The official Foundry Docker image hosted by Rosetta Commons is available at:
3+
# https://hub.docker.com/r/rosettacommons/foundry
4+
#
5+
# This Dockerfile serves as a reference starting point for building a custom
6+
# Foundry image. You may optionally exclude checkpoint file downloads to
7+
# reduce the final image size.
8+
#
9+
# Authors:
10+
# Hope Woods <hope.woods@omsf.io>
11+
# Rachel Clune <rachel.clune@omsf.io>
12+
# Sergey Lyskov <sergey.lyskov@gmail.com>
13+
14+
ARG BASE_IMAGE=ubuntu:22.04
15+
FROM ${BASE_IMAGE} AS BUILDER
16+
17+
COPY --from=ghcr.io/astral-sh/uv /uv /uvx /bin/
18+
19+
# Install system dependencies and build tools
20+
RUN apt-get update && apt-get install -y --no-install-recommends \
21+
ca-certificates \
22+
git \
23+
mc \
24+
build-essential \
25+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
26+
27+
# Set up app directory and user
28+
WORKDIR /app
29+
30+
# Create a virtual environment and install dependencies with uv
31+
RUN git clone https://github.com/RosettaCommons/foundry /app/foundry \
32+
&& cd /app/foundry \
33+
&& uv venv --python 3.12 \
34+
&& uv pip install ".[all]" \
35+
&& /app/foundry/.venv/bin/foundry --help \
36+
&& /app/foundry/.venv/bin/foundry install base-models --checkpoint-dir /app/foundry/checkpoints \
37+
&& uv cache clean \
38+
&& chmod -R a+rX /root \
39+
&& chmod -R a+rX /app \
40+
&& echo
41+
42+
#FINAL -------------------------------------------------------------------
43+
FROM ${BASE_IMAGE}
44+
45+
COPY --from=BUILDER /root /root
46+
COPY --from=BUILDER /app /app
47+
RUN chmod -R a+rX /root && chmod -R a+rX /app
48+
49+
RUN apt-get update && apt-get install -y --no-install-recommends \
50+
ca-certificates \
51+
mc \
52+
build-essential \
53+
&& apt-get clean \
54+
&& rm -rf /var/lib/apt/lists/*
55+
56+
# Activate the venv at container start
57+
ENV PATH="/app/foundry/.venv/bin:$PATH"
58+
WORKDIR /app/foundry
59+
60+
# Use bash as default shell
61+
SHELL ["/bin/bash", "-c"]
62+
63+
# Do not set a default command to run foundry since each models uses a different command
64+
CMD ["bash"]
65+

0 commit comments

Comments
 (0)