diff --git a/theia-extensions/k8s-app-old/Dockerfile b/theia-extensions/k8s-app-old/Dockerfile new file mode 100644 index 000000000..c4cb0b7b6 --- /dev/null +++ b/theia-extensions/k8s-app-old/Dockerfile @@ -0,0 +1,33 @@ +FROM ubuntu:18.04 + +RUN apt-get update && apt-get install -y \ + build-essential \ + gettext-base \ + git \ + jq \ + openjdk-8-jdk openjdk-8-jre openjdk-8-jdk-headless openjdk-8-jre-headless openjdk-8-source=8u162-b12-1 \ + curl + +RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - \ + && apt-get install -y nodejs + +RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ + && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ + && apt-get update \ + && apt-get install -y yarn + +RUN mkdir -p /home/project +# RUN adduser --disabled-password --gecos '' theia +# RUN chmod g+rw /home && \ +# mkdir -p /home/project && \ +# chown -R theia:theia /home/theia && \ +# chown -R theia:theia /home/project; +WORKDIR /home/theia +#USER theia + +ADD package.json ./package.json +RUN yarn --cache-folder ./ycache && rm -rf ./ycache +RUN yarn theia build +EXPOSE 3000 +ENV SHELL /bin/bash +ENTRYPOINT [ "yarn", "theia", "start", "/home/project", "--hostname=0.0.0.0" ] \ No newline at end of file diff --git a/theia-extensions/k8s-app/README.md b/theia-extensions/k8s-app-old/README.md similarity index 100% rename from theia-extensions/k8s-app/README.md rename to theia-extensions/k8s-app-old/README.md diff --git a/theia-extensions/k8s-app/build-all-and-deploy-to-k8s.sh b/theia-extensions/k8s-app-old/build-all-and-deploy-to-k8s.sh similarity index 100% rename from theia-extensions/k8s-app/build-all-and-deploy-to-k8s.sh rename to theia-extensions/k8s-app-old/build-all-and-deploy-to-k8s.sh diff --git a/theia-extensions/k8s-app/delete_theia_k8s.sh b/theia-extensions/k8s-app-old/delete_theia_k8s.sh similarity index 100% rename from theia-extensions/k8s-app/delete_theia_k8s.sh rename to theia-extensions/k8s-app-old/delete_theia_k8s.sh diff --git a/theia-extensions/k8s-app/deploy.sh b/theia-extensions/k8s-app-old/deploy.sh similarity index 100% rename from theia-extensions/k8s-app/deploy.sh rename to theia-extensions/k8s-app-old/deploy.sh diff --git a/theia-extensions/k8s-app/deploy.yml b/theia-extensions/k8s-app-old/deploy.yml similarity index 100% rename from theia-extensions/k8s-app/deploy.yml rename to theia-extensions/k8s-app-old/deploy.yml diff --git a/theia-extensions/k8s-app/deploy_theia_k8s.sh b/theia-extensions/k8s-app-old/deploy_theia_k8s.sh similarity index 100% rename from theia-extensions/k8s-app/deploy_theia_k8s.sh rename to theia-extensions/k8s-app-old/deploy_theia_k8s.sh diff --git a/theia-extensions/k8s-app/docker-boot-dev/Dockerfile b/theia-extensions/k8s-app-old/docker-boot-dev/Dockerfile similarity index 100% rename from theia-extensions/k8s-app/docker-boot-dev/Dockerfile rename to theia-extensions/k8s-app-old/docker-boot-dev/Dockerfile diff --git a/theia-extensions/k8s-app/docker-boot-dev/create-theia-boot-pkg.sh b/theia-extensions/k8s-app-old/docker-boot-dev/create-theia-boot-pkg.sh similarity index 100% rename from theia-extensions/k8s-app/docker-boot-dev/create-theia-boot-pkg.sh rename to theia-extensions/k8s-app-old/docker-boot-dev/create-theia-boot-pkg.sh diff --git a/theia-extensions/k8s-app/docker-boot-dev/package.json b/theia-extensions/k8s-app-old/docker-boot-dev/package.json similarity index 100% rename from theia-extensions/k8s-app/docker-boot-dev/package.json rename to theia-extensions/k8s-app-old/docker-boot-dev/package.json diff --git a/theia-extensions/k8s-app/docker-publish.sh b/theia-extensions/k8s-app-old/docker-publish.sh similarity index 100% rename from theia-extensions/k8s-app/docker-publish.sh rename to theia-extensions/k8s-app-old/docker-publish.sh diff --git a/theia-extensions/k8s-app-old/package.json b/theia-extensions/k8s-app-old/package.json new file mode 100644 index 000000000..fb6b92bb8 --- /dev/null +++ b/theia-extensions/k8s-app-old/package.json @@ -0,0 +1,37 @@ +{ + "private": true, + "name": "browser-app", + "version": "0.0.0", + "dependencies": { + "@pivotal-tools/theia-spring-boot": "latest", + "@theia/core": "latest", + "@theia/editor": "latest", + "@theia/file-search": "latest", + "@theia/filesystem": "latest", + "@theia/git": "latest", + "@theia/java": "latest", + "@theia/languages": "latest", + "@theia/markers": "latest", + "@theia/messages": "latest", + "@theia/monaco": "latest", + "@theia/navigator": "latest", + "@theia/outline-view": "latest", + "@theia/preferences": "latest", + "@theia/process": "latest", + "@theia/search-in-workspace": "latest", + "@theia/terminal": "latest", + "@theia/textmate-grammars": "latest", + "@theia/workspace": "latest" + }, + "devDependencies": { + "@theia/cli": "latest" + }, + "scripts": { + "prepare": "theia build", + "start": "theia start", + "watch": "theia build --watch" + }, + "theia": { + "target": "browser" + } +} diff --git a/theia-extensions/k8s-app/Dockerfile b/theia-extensions/k8s-app/Dockerfile index c4cb0b7b6..9170c722b 100644 --- a/theia-extensions/k8s-app/Dockerfile +++ b/theia-extensions/k8s-app/Dockerfile @@ -1,33 +1,27 @@ FROM ubuntu:18.04 - RUN apt-get update && apt-get install -y \ build-essential \ gettext-base \ git \ jq \ - openjdk-8-jdk openjdk-8-jre openjdk-8-jdk-headless openjdk-8-jre-headless openjdk-8-source=8u162-b12-1 \ + openjdk-8-jdk \ curl -RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - \ - && apt-get install -y nodejs +RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - +RUN apt-get install -y nodejs -RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ - && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ - && apt-get update \ - && apt-get install -y yarn +RUN npm install -g yarn -RUN mkdir -p /home/project -# RUN adduser --disabled-password --gecos '' theia -# RUN chmod g+rw /home && \ -# mkdir -p /home/project && \ -# chown -R theia:theia /home/theia && \ -# chown -R theia:theia /home/project; -WORKDIR /home/theia -#USER theia +RUN mkdir /theia-app +ADD package.json /theia-app +RUN cd /theia-app && \ + yarn && \ + yarn theia build -ADD package.json ./package.json -RUN yarn --cache-folder ./ycache && rm -rf ./ycache -RUN yarn theia build -EXPOSE 3000 +RUN mkdir /theia-app/plugins && \ + cd /theia-app/plugins && \ + curl --compressed -o vscode-spring-boot.vsix https://marketplace.visualstudio.com/_apis/public/gallery/publishers/Pivotal/vsextensions/vscode-spring-boot/1.13.0/vspackage +WORKDIR /theia-app ENV SHELL /bin/bash -ENTRYPOINT [ "yarn", "theia", "start", "/home/project", "--hostname=0.0.0.0" ] \ No newline at end of file +CMD [ "yarn", "theia", "start", "--hostname=0.0.0.0", "--plugins=local-dir:/theia-app/plugins/" ] +EXPOSE 3000 diff --git a/theia-extensions/k8s-app/docker-build-and-run.sh b/theia-extensions/k8s-app/docker-build-and-run.sh new file mode 100755 index 000000000..d23de36d9 --- /dev/null +++ b/theia-extensions/k8s-app/docker-build-and-run.sh @@ -0,0 +1,3 @@ +#!/bin/bash +docker build -t kdvolder/k8s-theia . +docker run -it -p 3000:3000 kdvolder/k8s-theia \ No newline at end of file diff --git a/theia-extensions/k8s-app/k8s-yaml/deployment.yml b/theia-extensions/k8s-app/k8s-yaml/deployment.yml new file mode 100644 index 000000000..ee3622dab --- /dev/null +++ b/theia-extensions/k8s-app/k8s-yaml/deployment.yml @@ -0,0 +1,21 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: theia-deployment + labels: + app: theia +spec: + replicas: 1 + selector: + matchLabels: + app: theia + template: + metadata: + labels: + app: theia + spec: + containers: + - name: theia + image: kdvolder/k8s-theia:latest + ports: + - containerPort: 3000 diff --git a/theia-extensions/k8s-app/package.json b/theia-extensions/k8s-app/package.json index fb6b92bb8..464794578 100644 --- a/theia-extensions/k8s-app/package.json +++ b/theia-extensions/k8s-app/package.json @@ -1,37 +1,27 @@ { "private": true, - "name": "browser-app", - "version": "0.0.0", "dependencies": { - "@pivotal-tools/theia-spring-boot": "latest", - "@theia/core": "latest", - "@theia/editor": "latest", - "@theia/file-search": "latest", - "@theia/filesystem": "latest", - "@theia/git": "latest", - "@theia/java": "latest", - "@theia/languages": "latest", - "@theia/markers": "latest", - "@theia/messages": "latest", - "@theia/monaco": "latest", - "@theia/navigator": "latest", - "@theia/outline-view": "latest", - "@theia/preferences": "latest", - "@theia/process": "latest", - "@theia/search-in-workspace": "latest", - "@theia/terminal": "latest", - "@theia/textmate-grammars": "latest", - "@theia/workspace": "latest" + "typescript": "latest", + "@theia/typescript": "next", + "@theia/navigator": "next", + "@theia/terminal": "next", + "@theia/outline-view": "next", + "@theia/preferences": "next", + "@theia/messages": "next", + "@theia/git": "next", + "@theia/file-search": "next", + "@theia/markers": "next", + "@theia/preview": "next", + "@theia/callhierarchy": "next", + "@theia/merge-conflicts": "next", + "@theia/search-in-workspace": "next", + "@theia/json": "next", + "@theia/textmate-grammars": "next", + "@theia/mini-browser": "next", + "@theia/plugin-ext": "next", + "@theia/plugin-ext-vscode": "next" }, "devDependencies": { - "@theia/cli": "latest" - }, - "scripts": { - "prepare": "theia build", - "start": "theia start", - "watch": "theia build --watch" - }, - "theia": { - "target": "browser" + "@theia/cli": "next" } }