-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added devcontainer to brick-template
- Loading branch information
Showing
2 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
FROM mcr.microsoft.com/devcontainers/python:3.9 | ||
|
||
# Install necessary packages | ||
RUN apt-get update && apt-get install -y \ | ||
wget \ | ||
unzip \ | ||
xvfb \ | ||
libxi6 \ | ||
libgconf-2-4 \ | ||
libnss3-dev \ | ||
libxss1 \ | ||
libappindicator1 \ | ||
fonts-liberation \ | ||
libatk-bridge2.0-0 \ | ||
libgtk-3-0 \ | ||
libgbm1 \ | ||
libasound2 \ | ||
libdpkg-perl \ | ||
libatomic1 \ | ||
ca-certificates \ | ||
curl \ | ||
gnupg \ | ||
python3-venv \ | ||
awscli | ||
|
||
# Install pipx and biobricks | ||
RUN python3 -m pip install --user pipx \ | ||
&& python3 -m pipx ensurepath | ||
|
||
# Create /mnt/biobricks directory and set permissions | ||
RUN mkdir -p /mnt/biobricks/biobricks-ai \ | ||
&& chown -R vscode:vscode /mnt/biobricks | ||
|
||
# Add pipx binaries to the PATH for all users | ||
RUN echo 'export PATH="$PATH:$HOME/.local/bin"' >> /etc/bash.bashrc \ | ||
&& echo 'export PATH="$PATH:$HOME/.local/bin"' >> /home/vscode/.bashrc | ||
|
||
# Switch to vscode user to perform user-specific installations | ||
USER vscode | ||
|
||
# Install Python dependencies | ||
COPY requirements.txt /tmp/requirements.txt | ||
RUN pip install -r /tmp/requirements.txt | ||
|
||
# Accept build argument for BIOBRICKS_TOKEN | ||
ARG BIOBRICKS_TOKEN | ||
ENV BIOBRICKS_TOKEN=${BIOBRICKS_TOKEN} | ||
|
||
# Install biobricks and configure it | ||
RUN /bin/bash -c 'source /etc/bash.bashrc && pipx install biobricks && biobricks version' \ | ||
&& /bin/bash -c 'if [ -z "$BIOBRICKS_TOKEN" ] || [ ${#BIOBRICKS_TOKEN} -lt 5 ]; then echo "BIOBRICKS_TOKEN is not set or is too short (less than 5 characters)"; exit 1; fi' \ | ||
&& /bin/bash -c 'source /etc/bash.bashrc && biobricks configure --bblib=/mnt/biobricks --token=${BIOBRICKS_TOKEN} --interactive=False' | ||
|
||
# Switch back to root user to complete setup | ||
USER root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "SMRT Development Container", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"context": "..", | ||
"args": { | ||
"BIOBRICKS_TOKEN": "${localEnv:BIOBRICKS_TOKEN}" | ||
} | ||
}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/docker-in-docker:1": {} | ||
}, | ||
"settings": { | ||
"terminal.integrated.defaultProfile.linux": "bash", | ||
"python.pythonPath": "/usr/local/bin/python" | ||
}, | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-toolsai.jupyter", | ||
"ms-vsliveshare.vsliveshare", // Live Share extension | ||
"github.copilot", // GitHub Copilot extension | ||
"insilica.vscode-pycmd" | ||
], | ||
"remoteUser": "vscode" | ||
} |