Rhev124 commited on
Commit
4c5eeff
·
verified ·
1 Parent(s): 91c5f0b

Upload 2 files

Browse files
Files changed (2) hide show
  1. Dockerfile +51 -0
  2. docker-compose.yml +67 -0
Dockerfile ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
2
+
3
+ # Install base utilities
4
+ RUN apt-get update \
5
+ && apt-get install -y build-essential \
6
+ && apt-get install -y wget git curl vim nano htop byobu zip unzip \
7
+ && apt-get clean \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # Install Docker
11
+ RUN curl -fsSL https://get.docker.com | sh
12
+
13
+ # Install miniconda
14
+ ENV CONDA_DIR=/opt/conda
15
+ RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
16
+ /bin/bash ~/miniconda.sh -b -p /opt/conda
17
+
18
+ # Put conda in path so we can use conda activate
19
+ ENV PATH=$CONDA_DIR/bin:$PATH
20
+
21
+ # Install jupyter
22
+ RUN pip install jupyter ipykernel nvitop
23
+ RUN pip install conda-pack
24
+
25
+ # Install zsh
26
+ RUN apt-get update && apt-get install -y zsh
27
+ RUN chsh -s /usr/bin/zsh
28
+ RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh && y)"
29
+ # COPY zsh config
30
+ COPY ./.zshrc /root/.zshrc
31
+ SHELL [ "/bin/zsh" , "-c" ]
32
+ ENV ZSH_CUSTOM=/root/.oh-my-zsh/custom
33
+ RUN git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions
34
+ RUN git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
35
+
36
+ # Install ssh
37
+ RUN apt-get update && apt-get install -y openssh-server
38
+ RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
39
+ RUN useradd -m -s /bin/bash developer
40
+ RUN echo 'developer:devserver123' | chpasswd
41
+ RUN service ssh start
42
+
43
+ # Install nettools
44
+ RUN apt install -y net-tools telnet traceroute
45
+
46
+ EXPOSE 22
47
+
48
+ WORKDIR /workspace
49
+
50
+ # RUN command
51
+ CMD [ "jupyter-notebook", "--no-browser", "--ip=0.0.0.0", "--port", "8080", "--allow-root", "--NotebookApp.token=devserver123" , "--notebook-dir=/workspace", "--NotebookApp.terminado_settings={'shell_command': ['/usr/bin/zsh']}"]
docker-compose.yml ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: '3.8'
2
+
3
+ services:
4
+ # Developer server
5
+ developer-server:
6
+ image: docker-essential:v1.0
7
+ container_name: dev-server
8
+ ports:
9
+ - "8888:8080"
10
+ - "8822:22"
11
+ - "8810:8810"
12
+ - "8811:8811"
13
+ - "8812:8812"
14
+ - "8813:8813"
15
+ - "8814:8814"
16
+ - "8815:8815"
17
+ - "8816:8816"
18
+ - "8817:8817"
19
+ - "8818:8818"
20
+ - "8819:8819"
21
+ runtime: nvidia
22
+ volumes:
23
+ - workspace:/workspace
24
+ - /var/run/docker.sock:/var/run/docker.sock
25
+ networks:
26
+ - developer-server
27
+ restart: always
28
+
29
+ # GitLab service
30
+ gitlab-web:
31
+ image: gitlab/gitlab-ce:latest
32
+ container_name: gitlab-web
33
+ hostname: 'localhost'
34
+ ports:
35
+ - "8080:80"
36
+ - "8843:443"
37
+ - "8802:22"
38
+ volumes:
39
+ - '$GITLAB_HOME/config:/etc/gitlab'
40
+ - '$GITLAB_HOME/logs:/var/log/gitlab'
41
+ - '$GITLAB_HOME/data:/var/opt/gitlab'
42
+ environment:
43
+ GITLAB_OMNIBUS_CONFIG: |
44
+ external_url 'http://localhost'
45
+ networks:
46
+ - developer-server
47
+ restart: always
48
+
49
+ gitlab-runner:
50
+ image: gitlab/gitlab-runner:alpine
51
+ container_name: gitlab-runner
52
+ restart: always
53
+ depends_on:
54
+ - gitlab-web
55
+ volumes:
56
+ - /var/run/docker.sock:/var/run/docker.sock
57
+ - '$GITLAB_HOME/gitlab-runner:/etc/gitlab-runner'
58
+ networks:
59
+ - developer-server
60
+
61
+ networks:
62
+ developer-server:
63
+ name: developer-server
64
+ driver: bridge
65
+
66
+ volumes:
67
+ workspace: