|
1 |
| -FROM ksimple/java8-mvn-nodejs-npm-python3 |
2 |
| -MAINTAINER tanhe123 from Coding IDE Team <tanhe123@coding.net> |
| 1 | +FROM java:8-jre-alpine |
3 | 2 |
|
4 | 3 | EXPOSE 8080
|
5 | 4 |
|
6 |
| -RUN apt-get update && apt-get install -y zsh && apt-get clean && rm -rf /var/lib/apt/lists/* |
7 |
| - |
8 |
| -# Add user `coding` |
9 |
| -RUN useradd --create-home --home-dir /home/coding --shell /usr/bin/zsh coding \ |
10 |
| - && echo "coding:coding" | chpasswd \ |
11 |
| - && adduser coding sudo \ |
12 |
| - && echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers |
13 |
| - |
14 |
| -USER coding |
15 |
| -ENV HOME /home/coding |
16 |
| -ENV SHELL /usr/bin/zsh |
17 |
| -ENV TERM xterm |
| 5 | +RUN set -ex && \ |
| 6 | + if [ $(wget -qO- ipinfo.io/country) == CN ]; then echo "http://mirrors.aliyun.com/alpine/latest-stable/main/" > /etc/apk/repositories ;fi && \ |
| 7 | + apk update && \ |
| 8 | + apk add --no-cache zsh git |
18 | 9 |
|
19 | 10 | # Install oh-my-zsh
|
20 |
| -RUN git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh \ |
| 11 | +RUN git clone --depth=1 git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh \ |
21 | 12 | && cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
|
22 | 13 |
|
23 |
| -ADD . /opt/coding/WebIDE |
24 |
| - |
25 |
| -RUN sudo chown -R coding /opt/coding/WebIDE \ |
26 |
| - && mkdir $HOME/.m2 |
| 14 | +ENV SHELL /bin/zsh |
27 | 15 |
|
28 |
| -RUN cd /opt/coding/WebIDE/frontend && npm install && npm run build \ |
29 |
| - && cd /opt/coding/WebIDE/frontend-webjars && mvn clean install \ |
30 |
| - && cd /opt/coding/WebIDE/backend && mvn clean package -Dmaven.test.skip=true \ |
31 |
| - && cp /opt/coding/WebIDE/backend/target/ide-backend.jar /opt/coding/WebIDE \ |
32 |
| - && cd /opt/coding/WebIDE/frontend && rm -r build node_modules \ |
33 |
| - && cd /opt/coding/WebIDE/frontend-webjars && mvn clean \ |
34 |
| - && cd /opt/coding/WebIDE/backend && mvn clean \ |
35 |
| - && rm -fr $HOME/.m2 |
| 16 | +ADD backend/target/ide-backend.jar /root |
| 17 | +ADD backend/src/main/resources/lib /root/lib |
36 | 18 |
|
37 |
| -ENV CODING_IDE_HOME /home/coding/coding-ide-home |
38 |
| -CMD ["java", "-jar", "/opt/coding/WebIDE/ide-backend.jar", "--PTY_LIB_FOLDER=/opt/coding/WebIDE/backend/src/main/resources/lib"] |
| 19 | +WORKDIR /root |
| 20 | +CMD ["java", "-jar", "ide-backend.jar", "--PTY_LIB_FOLDER=/root/lib"] |
0 commit comments