Skip to content

Commit

Permalink
Merge pull request #74 from khiron/devcontainer
Browse files Browse the repository at this point in the history
 fixes Create .devcontainer  #72
  • Loading branch information
GavinHuttley authored Dec 12, 2023
2 parents ffb5150 + 29bd5f0 commit 82135d3
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "cogent3.org",
"dockerFile": "../Dockerfile",
"settings": {
"terminal.integrated.shell.linux": "/bin/zsh"
},
"runArgs": [
"-v",
"/run/host-services/ssh-auth.sock:/ssh-auth.sock",
"-e",
"SSH_AUTH_SOCK=/ssh-auth.sock"
],
"postCreateCommand": "python -m venv c3org && echo 'source c3org/bin/activate' >> ~/.zshrc",
"extensions": ["ms-python.python"],
"workspaceFolder": "/cogent3.github.io",
"mounts": ["source=${localWorkspaceFolder},target=/cogent3.github.io,type=bind,consistency=cached"]
}
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM python:3.11-slim-buster

# Install any needed packages
RUN apt-get update && apt-get install -y \
zsh \
curl \
git \
&& rm -rf /var/lib/apt/lists/*

# Install Oh My Zsh
RUN sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# Make zsh the default shell
SHELL ["/bin/zsh", "-c"]

# Create the /cogent3.github.io directory
RUN mkdir -p /cogent3.github.io

# Set the working directory in the container to /cogent3.github.io
WORKDIR /cogent3.github.io

# Create a Python virtual environment outside of the workspace folder
RUN python -m venv /c3org

# Copy the requirements.txt file into the Docker image
COPY requirements.txt /cogent3.github.io/requirements.txt

#Update pip in the virtual environment
RUN /c3org/bin/python -m pip install --upgrade pip

# Install any needed packages specified in requirements.txt into the virtual environment
RUN /c3org/bin/pip install --no-cache-dir -r /cogent3.github.io/requirements.txt

# Activate the virtual environment when a new shell is started
RUN echo 'source /c3org/bin/activate' >> ~/.zshrc
Binary file modified requirements.txt
Binary file not shown.

0 comments on commit 82135d3

Please sign in to comment.