-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'datajoint:main' into master
- Loading branch information
Showing
4 changed files
with
38 additions
and
48 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 |
---|---|---|
@@ -1,43 +1,21 @@ | ||
FROM python:3.9-slim@sha256:5f0192a4f58a6ce99f732fe05e3b3d00f12ae62e183886bca3ebe3d202686c7f | ||
|
||
ENV PATH /usr/local/bin:$PATH | ||
ENV PYTHON_VERSION 3.9.17 | ||
|
||
RUN \ | ||
adduser --system --disabled-password --shell /bin/bash vscode && \ | ||
# install docker | ||
apt-get update && \ | ||
apt-get install ca-certificates curl gnupg lsb-release -y && \ | ||
mkdir -m 0755 -p /etc/apt/keyrings && \ | ||
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \ | ||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \ | ||
apt-get update && \ | ||
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y && \ | ||
usermod -aG docker vscode && \ | ||
apt-get clean | ||
ARG PY_VER | ||
ARG DISTRO | ||
FROM mcr.microsoft.com/devcontainers/python:${PY_VER}-${DISTRO} | ||
|
||
RUN \ | ||
# dev setup | ||
apt update && \ | ||
apt-get install sudo git gcc bash-completion graphviz default-mysql-client -y && \ | ||
usermod -aG sudo vscode && \ | ||
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \ | ||
pip install --no-cache-dir --upgrade black pip && \ | ||
echo '. /etc/bash_completion' >> /home/vscode/.bashrc && \ | ||
echo 'export PS1="\[\e[32;1m\]\u\[\e[m\]@\[\e[34;1m\]\H\[\e[m\]:\[\e[33;1m\]\w\[\e[m\]$ "' >> /home/vscode/.bashrc && \ | ||
pip install --no-cache-dir --upgrade black faker ipykernel pip && \ | ||
apt-get clean | ||
|
||
# tutorial dependencies | ||
COPY ./requirements.txt /tmp/ | ||
|
||
RUN \ | ||
# tutorial dependencies | ||
pip install --no-cache-dir black faker ipykernel && \ | ||
pip install --no-cache-dir -r /tmp/requirements.txt --upgrade && \ | ||
rm /tmp/requirements.txt | ||
|
||
ENV DJ_HOST fakeservices.datajoint.io | ||
USER root | ||
ENV DJ_HOST db | ||
ENV DJ_USER root | ||
ENV DJ_PASS simple | ||
|
||
USER vscode | ||
CMD bash -c "sudo rm /var/run/docker.pid; sudo dockerd" |
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
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 |
---|---|---|
@@ -1,17 +1,19 @@ | ||
version: "3" | ||
services: | ||
app: | ||
cpus: 2 | ||
mem_limit: 4g | ||
# build: # build context is used when developing locally | ||
# context: .. | ||
# dockerfile: ./.devcontainer/Dockerfile | ||
build: # build context is used when developing locally | ||
context: . | ||
dockerfile: .devcontainer/Dockerfile | ||
args: | ||
- PY_VER=${PY_VER:-3.11} | ||
- DISTRO=${DISTRO:-buster} | ||
image: datajoint/datajoint_tutorials:latest | ||
extra_hosts: | ||
- fakeservices.datajoint.io:127.0.0.1 | ||
volumes: | ||
- ..:/workspaces/datajoint-tutorials:cached | ||
- ..:/workspaces:cached | ||
- docker_data:/var/lib/docker # persist docker images | ||
privileged: true # only because of dind | ||
user: root | ||
# Overrides default command so things don't shut down after the process ends. | ||
command: /bin/sh -c "while sleep 1000; do :; done" | ||
volumes: | ||
docker_data: |
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