Theia spring boot ide docker file and k8s deployment (initial work)

This commit is contained in:
BoykoAlex
2019-06-12 13:36:07 -04:00
parent 1dba7419fd
commit c25fc4dc38
4 changed files with 114 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
FROM ubuntu:18.04
RUN apt-get update && apt-get install -y \
build-essential \
gettext-base \
git \
jq \
openjdk-8-jdk=8u162-b12-1 openjdk-8-jre=8u162-b12-1 openjdk-8-jdk-headless=8u162-b12-1 openjdk-8-jre-headless=8u162-b12-1 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 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" ]

View File

@@ -0,0 +1,5 @@
git_repo=$1
clone_folder="${git_repo##*/}"
rm -rf ${clone_folder}
git clone ${git_repo}
docker run -it -p 3000:3000 -v "$(pwd)/${clone_folder}:/home/project" $2

View File

@@ -0,0 +1,40 @@
apiVersion: v1
kind: Deployment
metadata:
name: theia-spring-boot
spec:
replicas: 1
selector:
matchLabels:
name: theia-spring-boot
template:
metadata:
labels:
name: theia-spring-boot
spec:
containers:
- name: theia-spring-boot
image: theia-spring-boot
ports:
- containerPort: 3000
volumeMounts:
- name: source
mountPath: /home/project
- name: git-sync
image: k8s.gcr.io/git-sync-amd64:v2.0.6
imagePullPolicy: Always
volumeMounts:
- name: source
mountPath: /home
env:
- name: GIT_SYNC_REPO
value: https://github.com/spring-projects/spring-petclinic.git
- name: GIT_SYNC_BRANCH
value: master
- name: GIT_SYNC_ROOT
value: /home
- name: GIT_SYNC_DEST
value: /home
volumes:
- name: source
emptyDir: {}

View File

@@ -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"
}
}