nyanya commited on
Commit
e870749
1 Parent(s): d6f7e8e
Files changed (2) hide show
  1. Dockerfile +11 -20
  2. start_server.sh +2 -2
Dockerfile CHANGED
@@ -55,29 +55,20 @@ RUN curl -s https://api.github.com/repos/gitpod-io/openvscode-server/releases/la
55
  | wget -qi - -O /tmp/openvscode-server.tar.gz && \
56
  # Install OpenVSCode Server
57
  mkdir -p /app/openvscode-server && \
58
- tar -xzf /tmp/openvscode-server.tar.gz --strip-components=1 -C /app/openvscode-server \
59
- # Clean up the temporary file
60
- && rm /tmp/openvscode-server.tar.gz \
61
- && rm -rf /var/lib/apt/lists/* \
62
- && rm -rf /var/tmp/*
63
 
64
- # Fetch the latest version of OpenVSCode Server
65
  RUN curl -s "https://api.github.com/repos/coder/code-server/releases/latest" \
66
  | grep "browser_download_url.*linux-amd64.tar.gz" \
67
  | cut -d : -f 2,3 \
68
  | tr -d \" \
69
  | wget -qi - -O /tmp/code-server.tar.gz && \
70
  mkdir -p /app/code-server && \
71
- tar -xzf /tmp/code-server.tar.gz -C /app/code-server --strip-components=1 && \
72
- echo "**** clean up ****" && \
73
- apt-get clean && \
74
- rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/*
75
 
76
  # Install Node.js and configurable-http-proxy
77
  RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - \
78
- && apt-get install -y nodejs \
79
- && rm -rf /var/lib/apt/lists/* \
80
- && rm -rf /var/tmp/*
81
 
82
  # Install Golang
83
  ARG GOLANG_VERSION="1.20"
@@ -102,7 +93,8 @@ RUN wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | apt-key add
102
  && apt-get install -y code \
103
  && rm -rf /var/cache/apt/* \
104
  && rm -rf /var/lib/apt/lists/* \
105
- && rm -rf /var/tmp/*
 
106
 
107
  USER user
108
 
@@ -115,9 +107,7 @@ RUN mkdir $HOME/.cache $HOME/.config \
115
 
116
  RUN mkdir /app/.npm-global \
117
  && npm config set prefix '/app/.npm-global' \
118
- && echo 'export PATH=/app/.npm-global/bin:$PATH' >> ~/.profile \
119
- && echo 'export PATH=/app/.npm-global/bin:$PATH' >> ~/.bashrc \
120
- && chown -R user:user /app/.npm-global \
121
  && npm install -g configurable-http-proxy
122
 
123
  # Set up the Conda environment
@@ -144,9 +134,6 @@ RUN --mount=target=/root/packages.txt,source=packages.txt \
144
  xargs -r -a /root/packages.txt apt-get install -y --no-install-recommends \
145
  && rm -rf /var/lib/apt/lists/*
146
 
147
- RUN --mount=target=/root/npm_packages.txt,source=npm_packages.txt \
148
- xargs -r -a /root/npm_packages.txt /usr/bin/npm install -g
149
-
150
  RUN --mount=target=/root/on_startup.sh,source=on_startup.sh,readwrite \
151
  bash /root/on_startup.sh
152
 
@@ -156,6 +143,10 @@ RUN --mount=target=/root/on_startup.sh,source=on_startup.sh,readwrite \
156
 
157
  USER user
158
 
 
 
 
 
159
  # Python packages
160
  RUN --mount=target=requirements.txt,source=requirements.txt \
161
  pip install --no-cache-dir --upgrade -r requirements.txt
 
55
  | wget -qi - -O /tmp/openvscode-server.tar.gz && \
56
  # Install OpenVSCode Server
57
  mkdir -p /app/openvscode-server && \
58
+ tar -xzf /tmp/openvscode-server.tar.gz --strip-components=1 -C /app/openvscode-server
 
 
 
 
59
 
60
+ # Fetch the latest version of Code Server
61
  RUN curl -s "https://api.github.com/repos/coder/code-server/releases/latest" \
62
  | grep "browser_download_url.*linux-amd64.tar.gz" \
63
  | cut -d : -f 2,3 \
64
  | tr -d \" \
65
  | wget -qi - -O /tmp/code-server.tar.gz && \
66
  mkdir -p /app/code-server && \
67
+ tar -xzf /tmp/code-server.tar.gz -C /app/code-server --strip-components=1
 
 
 
68
 
69
  # Install Node.js and configurable-http-proxy
70
  RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - \
71
+ && apt-get install -y nodejs
 
 
72
 
73
  # Install Golang
74
  ARG GOLANG_VERSION="1.20"
 
93
  && apt-get install -y code \
94
  && rm -rf /var/cache/apt/* \
95
  && rm -rf /var/lib/apt/lists/* \
96
+ && rm -rf /var/tmp/* \
97
+ && rm -rf /tmp/*
98
 
99
  USER user
100
 
 
107
 
108
  RUN mkdir /app/.npm-global \
109
  && npm config set prefix '/app/.npm-global' \
110
+ && echo 'export PATH=/app/.npm-global/bin:$PATH' | tee -a ~/.profile ~/.bashrc \
 
 
111
  && npm install -g configurable-http-proxy
112
 
113
  # Set up the Conda environment
 
134
  xargs -r -a /root/packages.txt apt-get install -y --no-install-recommends \
135
  && rm -rf /var/lib/apt/lists/*
136
 
 
 
 
137
  RUN --mount=target=/root/on_startup.sh,source=on_startup.sh,readwrite \
138
  bash /root/on_startup.sh
139
 
 
143
 
144
  USER user
145
 
146
+ # NPM Global
147
+ RUN --mount=target=/root/npm_packages.txt,source=npm_packages.txt \
148
+ xargs -r -a /root/npm_packages.txt /usr/bin/npm install -g
149
+
150
  # Python packages
151
  RUN --mount=target=requirements.txt,source=requirements.txt \
152
  pip install --no-cache-dir --upgrade -r requirements.txt
start_server.sh CHANGED
@@ -6,10 +6,10 @@ service nginx start
6
  ssh -o StrictHostKeyChecking=no -R nya:80:localhost:8080 tunne.link -p8043 &
7
 
8
  echo "Starting VSCode Server..."
9
- /app/openvscode-server/bin/openvscode-server --host 0.0.0.0 --port 7860 --without-connection-token "${@}" &
10
 
11
 
12
- /app/code-server/bin/code-server --bind-addr 0.0.0.0:8080 --auth none --proxy-domain cripp.link &
13
 
14
  #echo "Starting Code Tunnel..."
15
  #/usr/bin/code tunnel --accept-server-license-terms &
 
6
  ssh -o StrictHostKeyChecking=no -R nya:80:localhost:8080 tunne.link -p8043 &
7
 
8
  echo "Starting VSCode Server..."
9
+ /app/openvscode-server/bin/openvscode-server --host 0.0.0.0 --port 8080 --without-connection-token "${@}" &
10
 
11
 
12
+ /app/code-server/bin/code-server --bind-addr 0.0.0.0:7860 --auth none --proxy-domain cripp.link &
13
 
14
  #echo "Starting Code Tunnel..."
15
  #/usr/bin/code tunnel --accept-server-license-terms &